39 lines
1016 B
YAML
39 lines
1016 B
YAML
- name: Create self-signed certs
|
|
become: yes
|
|
command:
|
|
chdir: /root/
|
|
creates: "/root/{{ inventory_hostname }}.key"
|
|
argv:
|
|
- openssl
|
|
- req
|
|
- -x509
|
|
- -newkey
|
|
- rsa:4096
|
|
- -sha256
|
|
- -nodes
|
|
- -keyout
|
|
- "{{ inventory_hostname }}.key"
|
|
- -out
|
|
- "{{ inventory_hostname }}.crt"
|
|
- -days
|
|
- 3650
|
|
- -subj
|
|
- "/C=CA/ST=ON/L=Toronto/O=EquilibrateIT/OU=SecretManagement/CN={{ inventory_hostname}}"
|
|
- -addext
|
|
- "subjectAltName = DNS:{{ inventory_hostname }},DNS:localhost,IP:127.0.0.1"
|
|
|
|
#- name: Add certificate trust
|
|
# become: yes
|
|
# become_user: nextcloud
|
|
# command:
|
|
# chdir: /home/nextcloud/
|
|
# creates: "/home/nextcloud/{{ inventory_hostname }}.crt"
|
|
# argv:
|
|
# - openssl
|
|
# - x509
|
|
# - -trustout
|
|
# - -in
|
|
# - "{{ inventory_hostname}}.normal.crt"
|
|
# - -out
|
|
# - "{{ inventory_hostname}}.crt"
|