coursework/ansible/roles/ssl_certificate/tasks/main.yml

22 lines
543 B
YAML
Raw Normal View History

2024-11-12 20:14:17 +00:00
- name: Install OpenSSL
zypper:
name: openssl
state: present
- name: Create SSL directory
file:
path: "{{ ssl_cert_path }}"
state: directory
owner: root
group: root
mode: '0755'
- name: Generate Self-Signed SSL Certificate
command: >
openssl req -x509 -nodes -days 365
-newkey rsa:2048
-keyout {{ ssl_cert_path }}/{{ ssl_key_file }}
-out {{ ssl_cert_path }}/{{ ssl_cert_file }}
-subj "{{ ssl_subject }}"
args:
creates: "{{ ssl_cert_path }}/{{ ssl_cert_file }}"