coursework/ansible/roles/site_setup/tasks/generate_ssl.yml
2024-11-11 13:48:06 +03:00

25 lines
604 B
YAML

---
- name: Ensure SSL directory exists
file:
path: /etc/nginx/ssl
state: directory
mode: '0755'
tags: ssl
- name: Generate self-signed SSL certificate
openssl_certificate:
path: /etc/nginx/ssl/{{ proxy_name }}.crt
privatekey_path: /etc/nginx/ssl/{{ proxy_name }}.key
common_name: "{{ proxy_name }}"
state: present
selfsigned: yes
owner: root
group: root
mode: '0644'
subject:
- organizationName: "Example Company"
- organizationalUnitName: "IT"
- localityName: "City"
- countryName: "US"
tags: ssl