feat: check if the port 80 is used
This commit is contained in:
parent
b9e7adfe81
commit
b00d571718
2 changed files with 10 additions and 6 deletions
|
@ -14,6 +14,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
|
||||||
|
|
||||||
- test: replace kitchen to molecule
|
- test: replace kitchen to molecule
|
||||||
- chore: use FQCN for module name
|
- chore: use FQCN for module name
|
||||||
|
- feat: check if the port 80 is used
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,13 @@
|
||||||
register: st
|
register: st
|
||||||
tags: certbot
|
tags: certbot
|
||||||
|
|
||||||
- name: check if nginx is launch
|
- name: check if a webservice is started on port 80
|
||||||
ansible.builtin.stat:
|
ansible.builtin.wait_for:
|
||||||
path: /var/run/nginx.pid
|
port: 80
|
||||||
register: ng
|
state: started
|
||||||
|
timeout: 5
|
||||||
|
ignore_errors: true
|
||||||
|
register: web
|
||||||
tags: certbot
|
tags: certbot
|
||||||
|
|
||||||
- name: create a new certificate
|
- name: create a new certificate
|
||||||
|
@ -17,7 +20,7 @@
|
||||||
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
|
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
|
||||||
--webroot --webroot-path {{ certbot_path }} --rsa-key-size {{ certbot_key_size }}
|
--webroot --webroot-path {{ certbot_path }} --rsa-key-size {{ certbot_key_size }}
|
||||||
loop: '{{ st.results }}'
|
loop: '{{ st.results }}'
|
||||||
when: (certbot_role == 'master' or item.item.name == ansible_fqdn) and not item.stat.exists and ng.stat.exists
|
when: (certbot_role == 'master' or item.item.name == ansible_fqdn) and not item.stat.exists and not web.failed
|
||||||
tags: certbot
|
tags: certbot
|
||||||
|
|
||||||
- name: create a new certificate (standalone)
|
- name: create a new certificate (standalone)
|
||||||
|
@ -25,5 +28,5 @@
|
||||||
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
|
certbot certonly -n --agree-tos -d {{ item.item.name }} -m {{ certbot_mail }}
|
||||||
--standalone --rsa-key-size {{ certbot_key_size }}
|
--standalone --rsa-key-size {{ certbot_key_size }}
|
||||||
loop: '{{ st.results }}'
|
loop: '{{ st.results }}'
|
||||||
when: (certbot_role == 'master' or item.item.name == ansible_fqdn) and not item.stat.exists and not ng.stat.exists
|
when: (certbot_role == 'master' or item.item.name == ansible_fqdn) and not item.stat.exists and web.failed
|
||||||
tags: certbot
|
tags: certbot
|
||||||
|
|
Loading…
Reference in a new issue