Skip to content
Snippets Groups Projects
Commit 2a27b91a authored by Nicolas KAROLAK's avatar Nicolas KAROLAK
Browse files

syntax update

parent c112d9c8
No related branches found
No related tags found
No related merge requests found
......@@ -5,17 +5,16 @@
force_apt_get: true
install_recommends: false
name: certbot
state: present
- name: get all server_name values
when: letsencrypt_domains == []
changed_when: false
register: letsencryt_nginx_output
shell: |
set -o pipefail
nginx -T 2>&1 | grep -v localhost | grep -P '^\s+server_name\s+.*;$' | sed -r 's/\s+server_name\s+(.*);/\1/' | uniq
args:
shell:
executable: /bin/bash
changed_when: false
cmd: |
set -o pipefail
nginx -T 2>&1 | grep -v localhost | grep -P '^\s+server_name\s+.*;$' | sed -r 's/\s+server_name\s+(.*);/\1/' | uniq
- name: save result as list
when: letsencrypt_domains == []
......@@ -66,13 +65,14 @@
- letsencrypt_save_list is changed
register: letsencrypt_dry_run
ignore_errors: true
command: |
certbot certonly \
--dry-run \
-n --agree-tos -m {{ letsencrypt_email }} \
--webroot -w {{ letsencrypt_webroot }} \
--expand \
-d {{ letsencrypt_domains | join(',') }}
command:
cmd: |
certbot certonly \
--dry-run \
-n --agree-tos -m {{ letsencrypt_email }} \
--webroot -w {{ letsencrypt_webroot }} \
--expand \
-d {{ letsencrypt_domains | join(',') }}
- name: remove domains list file in case of failure
when: letsencrypt_dry_run is failed
......@@ -90,13 +90,14 @@
- letsencrypt_domains != []
- letsencrypt_save_list is changed
- letsencrypt_dry_run is succeeded
command: |
certbot certonly \
{% if letsencrypt_testing %}--staging{% endif %} \
-n --agree-tos -m {{ letsencrypt_email }} \
--webroot -w {{ letsencrypt_webroot }} \
--expand \
-d {{ letsencrypt_domains | join(',') }}
command:
cmd: |
certbot certonly \
{% if letsencrypt_testing %}--staging{% endif %} \
-n --agree-tos -m {{ letsencrypt_email }} \
--webroot -w {{ letsencrypt_webroot }} \
--expand \
-d {{ letsencrypt_domains | join(',') }}
- name: update nginx certificate configuration
when:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment