diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2024-02-08 13:32:37 +0100 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2024-02-08 13:33:36 +0100 |
commit | adfb09b9e19f7a31632eab01171693cb81ec75ef (patch) | |
tree | 7b05135581ff49e7a5655ab07af7bba2ada43585 /roles/acme/tasks | |
parent | 5c5b0fbf68dca224b7f92f5de0913fd684e7d3d9 (diff) | |
download | rules-adfb09b9e19f7a31632eab01171693cb81ec75ef.tar.gz |
refactor(roles): new variable naming standard
Diffstat (limited to 'roles/acme/tasks')
-rw-r--r-- | roles/acme/tasks/main.yml | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/roles/acme/tasks/main.yml b/roles/acme/tasks/main.yml index 040c176..0435265 100644 --- a/roles/acme/tasks/main.yml +++ b/roles/acme/tasks/main.yml @@ -3,7 +3,7 @@ - name: generate acme-client configuration ansible.builtin.template: src: acme-client.conf.j2 - dest: "{{ acme_configuration_file }}" + dest: "{{ acme__configuration_file }}" owner: 0 group: 0 mode: "0644" @@ -11,20 +11,20 @@ - name: retrieve enabled domains ansible.builtin.shell: | set -o pipefail - grep "^domain" {{ acme_configuration_file }} | cut -d " " -f 2 - register: acme_result_subdomains + grep "^domain" {{ acme__configuration_file }} | cut -d " " -f 2 + register: acme__result_subdomains changed_when: false - name: generate acme certificates ansible.builtin.command: acme-client -v {{ item }} - loop: "{{ acme_result_subdomains.stdout_lines }}" - register: acme_result_generation - failed_when: acme_result_generation.rc == 1 - changed_when: acme_result_generation.rc != 2 + loop: "{{ acme__result_subdomains.stdout_lines }}" + register: acme__result_generation + failed_when: acme__result_generation.rc == 1 + changed_when: acme__result_generation.rc != 2 - name: display registered certificates ansible.builtin.debug: - msg: "{{ acme_result_generation.results | map(attribute='stderr') + msg: "{{ acme__result_generation.results | map(attribute='stderr') | join('\n') }}" - name: enable automatic acme certificates update @@ -33,4 +33,9 @@ minute: 0 hour: 6,18 job: "acme-client -v {{ item }} && rcctl reload relayd" - loop: "{{ acme_result_subdomains.stdout_lines }}" + loop: "{{ acme__result_subdomains.stdout_lines }}" + +- name: restart relayd + ansible.builtin.service: + name: relayd + state: restarted |