# - ssl_lifetime: the lifetime of the certificate in days
# - ssl_rsa_key_size: the size of the RSA key for the certificate
- name: create a ssh-certificate
- ansible.builtin.command: 'openssl req -x509 -nodes -days {{ssl_lifetime}} \
- -newkey rsa:{{ssl_rsa_key_size}} \
- -keyout /etc/ssl/private/{{domain}}.key \
- -out /etc/ssl/certs/{{domain}}.pem \
- -subj "/C={{ssl_country}}/ST={{ssl_state}}/L={{ssl_locality}}/O={{ssl_organization}}/CN={{domain}}"''
+ ansible.builtin.command: 'openssl req -x509 -nodes -days {{ssl_lifetime}} -newkey rsa:{{ssl_rsa_key_size}} -keyout /etc/ssl/private/{{domain}}.key -out /etc/ssl/certs/{{domain}}.pem -subj "/C={{ssl_country}}/ST={{ssl_state}}/L={{ssl_locality}}/O={{ssl_organization}}/CN={{domain}}"'
args:
creates: /etc/ssl/private/{{domain}}.key