coursework/ansible/roles/site_setup/tasks/generate_ssl.yml
2024-11-11 23:16:26 +03:00

26 lines
589 B
YAML

- name: Ensure SSL directory exists
file:
path: /etc/nginx/ssl
state: directory
mode: '0700'
tags: ssl
- name: Generate private key
openssl_privatekey:
path: /etc/nginx/ssl/{{ proxy_name }}.key
size: 2048
type: RSA
mode: '0600'
owner: root
group: root
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
owner: root
group: root
mode: '0600'
provider: selfsigned
tags: ssl