make it work on RH
This commit is contained in:
+14
-11
@@ -1,4 +1,9 @@
|
||||
---
|
||||
- name: debug
|
||||
debug:
|
||||
msg: "plop {{ apache_server_alias }}"
|
||||
changed_when: true
|
||||
|
||||
- name: install certbot
|
||||
package:
|
||||
name:
|
||||
@@ -24,19 +29,17 @@
|
||||
state: restarted
|
||||
when: result.changed
|
||||
|
||||
- name: "check if certificate already exists"
|
||||
ansible.builtin.stat:
|
||||
path: "/etc/letsencrypt/live/{{ apache_server_name }}/cert.pem"
|
||||
register: cert_stat
|
||||
|
||||
- name: generate certificates for domaine and subdomains
|
||||
vars:
|
||||
subdomains: "-d {{ apache_server_alias | join( ' -d ' ) }}"
|
||||
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }} {{ subdomains }}
|
||||
args:
|
||||
creates: "{{ apache_ssl_chain }}"
|
||||
when: apache_server_alias is defined
|
||||
|
||||
- name: generate certificates
|
||||
command: certbot certonly --agree-tos --non-interactive -m {{ apache_ssl_root_email }} --webroot --webroot-path {{ apache_document_root }} -d {{ apache_server_name }}
|
||||
args:
|
||||
creates: "{{ apache_ssl_chain }}"
|
||||
when: apache_server_alias is not defined
|
||||
domainlist: "{{ [ apache_server_name ] + apache_server_alias|default( '') }}"
|
||||
subdomains: "-d {{ domainlist | join( ' -d ' ) }}"
|
||||
command: certbot certonly --webroot --webroot-path {{ certbot_docroot }} --agree-tos --non-interactive -m {{ certbot_email }} {{ subdomains }} --expand
|
||||
when: not cert_stat.stat.exists
|
||||
|
||||
- name: deploy ssl config file
|
||||
template:
|
||||
|
||||
Reference in New Issue
Block a user