coursework/ansible/roles/site_setup/tasks/generate_ssl.yml

26 lines
589 B
YAML
Raw Normal View History

2024-11-11 10:48:06 +00:00
- name: Ensure SSL directory exists
file:
path: /etc/nginx/ssl
state: directory
2024-11-11 20:16:26 +00:00
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
2024-11-11 10:48:06 +00:00
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
2024-11-11 20:16:26 +00:00
mode: '0600'
provider: selfsigned
tags: ssl