generate self signed certificate
This commit is contained in:
parent
f5ab92a99e
commit
f5acec43ec
4 changed files with 32 additions and 0 deletions
3
group_vars/all/generate_self_signed_certificate.yml
Normal file
3
group_vars/all/generate_self_signed_certificate.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
country_name: FR
|
||||||
|
organization_name: Pains-Perdus
|
1
hosts
1
hosts
|
@ -27,6 +27,7 @@ all:
|
||||||
keycloak_host:
|
keycloak_host:
|
||||||
hosts:
|
hosts:
|
||||||
vb2:
|
vb2:
|
||||||
|
server_hostname: 10.0.2.9
|
||||||
gitea_host:
|
gitea_host:
|
||||||
hosts:
|
hosts:
|
||||||
vb1:
|
vb1:
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
- hosts: keycloak_host
|
- hosts: keycloak_host
|
||||||
roles:
|
roles:
|
||||||
- install_docker
|
- install_docker
|
||||||
|
- generate_self_signed_certificate
|
||||||
- install_keycloak
|
- install_keycloak
|
||||||
|
|
27
roles/generate_self_signed_certificate/tasks/main.yml
Normal file
27
roles/generate_self_signed_certificate/tasks/main.yml
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
- name: Ensure the cert directory exists
|
||||||
|
file:
|
||||||
|
path: /var/certificates
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Generate an OpenSSL private key
|
||||||
|
openssl_privatekey:
|
||||||
|
path: "/var/certificates/{{ server_hostname }}_privkey.pem"
|
||||||
|
size: 4096
|
||||||
|
type: RSA
|
||||||
|
|
||||||
|
- name: Generate an OpenSSL Certificate Signing Request with Subject information
|
||||||
|
openssl_csr:
|
||||||
|
path: "/var/certificates/{{ server_hostname }}.csr"
|
||||||
|
privatekey_path: "/var/certificates/{{ server_hostname }}_privkey.pem"
|
||||||
|
country_name: "{{ country_name }}"
|
||||||
|
organization_name: "{{ organization_name }}"
|
||||||
|
email_address: "{{ vault_email }}"
|
||||||
|
common_name: "{{ server_hostname }}"
|
||||||
|
|
||||||
|
- name: Generate a Self Signed OpenSSL certificate
|
||||||
|
openssl_certificate:
|
||||||
|
path: "/var/certificates/{{ server_hostname }}_cert.pem"
|
||||||
|
privatekey_path: "/var/certificates/{{ server_hostname }}_privkey.pem"
|
||||||
|
csr_path: "/var/certificates/{{ server_hostname }}.csr"
|
||||||
|
provider: selfsigned
|
Loading…
Reference in a new issue