Fix a result override preventing apps reload.

Because even with the when, the var is overridden.
This commit is contained in:
Lucas Maurice 2020-12-07 18:59:30 -05:00
parent 67acb4b317
commit 78b805c429
1 changed files with 11 additions and 1 deletions

View File

@ -3,12 +3,14 @@
apt:
update_cache: true
when: ansible_os_family == 'Debian'
changed_when: False
- name: Install dependencies
package:
name:
- git
- wget
state: present
- name: Create git clone path
file:
@ -77,10 +79,18 @@
- acme_cloudflare_token is defined
- acme_cloudflare_email is defined
loop: "{{ acme_sh_domains }}"
register: issue_result
register: issue_result2
changed_when: issue_result.rc == 0 and "Cert success" in issue_result.stdout and not item.force_renew | default(false)
failed_when: issue_result.rc != 0 and "Domains not changed" not in issue_result.stdout
# Because even with the when, the var is overridden.
- name: Grab the good issue result
set_fact:
issue_result: "{{ issue_result2 }}"
when:
- acme_cloudflare_token is defined
- acme_cloudflare_email is defined
- name: Install acme.sh certificate(s)
command: >-
./acme.sh --install-cert -d {{ item.domain }}