diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2026-10-07 21:06:35 -0700 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2026-10-11 18:36:50 -0700 |
| commit | f60e2a723c744628823cad6344a8d3d0dd4c32e4 (patch) | |
| tree | 02201b37edbe05070aac9c5f2c2335dbe25c22bc /roles/acme_client | |
| parent | Retab file (diff) | |
| download | site-configs-f60e2a723c744628823cad6344a8d3d0dd4c32e4.zip | |
Update configs
Diffstat (limited to 'roles/acme_client')
| -rw-r--r-- | roles/acme_client/handlers/main.yml | 6 | ||||
| -rw-r--r-- | roles/acme_client/tasks/main.yml | 13 | ||||
| -rw-r--r-- | roles/acme_client/templates/httpd.d/acme.conf (renamed from roles/acme_client/files/httpd.d/acme.conf) | 0 |
3 files changed, 8 insertions, 11 deletions
diff --git a/roles/acme_client/handlers/main.yml b/roles/acme_client/handlers/main.yml deleted file mode 100644 index ca566a6..0000000 --- a/roles/acme_client/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: run acme-client - ansible.builtin.command: acme-client {{ acme_domain }} - changed_when: true - -- name: restart httpd - ansible.builtin.command: rcctl restart httpd diff --git a/roles/acme_client/tasks/main.yml b/roles/acme_client/tasks/main.yml index 54cd70c..35974e0 100644 --- a/roles/acme_client/tasks/main.yml +++ b/roles/acme_client/tasks/main.yml @@ -1,11 +1,11 @@ - name: Deploy acme challenge vhost fragment - ansible.builtin.copy: + ansible.builtin.template: src: httpd.d/acme.conf dest: "{{ httpd_conf_d | default('/etc/httpd.d') }}/acme.conf" owner: root group: wheel mode: "0644" - notify: restart httpd + register: acme_vhost_config - name: Deploy acme-client.conf ansible.builtin.template: @@ -15,10 +15,13 @@ group: wheel mode: "0600" -- name: Flush handlers so httpd restarts before issuing cert - ansible.builtin.meta: flush_handlers +- name: Restart httpd + ansible.builtin.service: + name: httpd + state: restarted + when: acme_vhost_config is changed -- name: Ensure certificates exist +- name: Generate certificate ansible.builtin.command: acme-client {{ acme_domain }} args: creates: "/etc/ssl/{{ acme_domain }}.fullchain.pem" diff --git a/roles/acme_client/files/httpd.d/acme.conf b/roles/acme_client/templates/httpd.d/acme.conf index 558a8bd..558a8bd 100644 --- a/roles/acme_client/files/httpd.d/acme.conf +++ b/roles/acme_client/templates/httpd.d/acme.conf |