coursework/ansible/roles/ssl_certificate_cmd/tasks/main.yml
2024-12-08 21:23:31 +03:00

20 lines
478 B
YAML

- 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 }}"