From 9bffa36a339f52e24c621e09feafc2a8ca0e681c Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Sat, 23 Feb 2019 23:54:24 +0100 Subject: [PATCH] acertmgr: rename from certmgr, run on config change --- roles/{certmgr => acertmgr}/tasks/main.yml | 0 roles/{certmgr => acertmgr}/templates/acme.conf.j2 | 0 roles/bk-dss/handlers/main.yml | 6 +++--- roles/bk-dss/meta/main.yml | 2 +- roles/bk-dss/tasks/main.yml | 2 +- roles/gogs/handlers/main.yml | 3 +++ roles/gogs/meta/main.yml | 2 +- roles/gogs/tasks/main.yml | 1 + roles/hackmd/handlers/main.yml | 3 +++ roles/hackmd/meta/main.yml | 2 +- roles/hackmd/tasks/main.yml | 1 + roles/librenms/handlers/main.yml | 3 +++ roles/librenms/meta/main.yml | 2 +- roles/librenms/tasks/main.yml | 1 + roles/mail/handlers/main.yml | 3 +++ roles/mail/meta/main.yml | 2 +- roles/mail/tasks/main.yml | 2 ++ roles/owncloud/meta/main.yml | 2 +- roles/owncloud/tasks/main.yml | 1 + roles/partdb/handlers/main.yml | 2 +- roles/partdb/meta/main.yml | 2 +- roles/partdb/tasks/main.yml | 2 +- roles/prosody/handlers/main.yml | 3 +++ roles/prosody/meta/main.yml | 2 +- roles/prosody/tasks/main.yml | 1 + roles/racktables/handlers/main.yml | 3 +++ roles/racktables/meta/main.yml | 2 +- roles/racktables/tasks/main.yml | 1 + roles/web/handlers/main.yml | 2 +- roles/web/meta/main.yml | 2 +- roles/web/tasks/main.yml | 2 +- 31 files changed, 44 insertions(+), 18 deletions(-) rename roles/{certmgr => acertmgr}/tasks/main.yml (100%) rename roles/{certmgr => acertmgr}/templates/acme.conf.j2 (100%) diff --git a/roles/certmgr/tasks/main.yml b/roles/acertmgr/tasks/main.yml similarity index 100% rename from roles/certmgr/tasks/main.yml rename to roles/acertmgr/tasks/main.yml diff --git a/roles/certmgr/templates/acme.conf.j2 b/roles/acertmgr/templates/acme.conf.j2 similarity index 100% rename from roles/certmgr/templates/acme.conf.j2 rename to roles/acertmgr/templates/acme.conf.j2 diff --git a/roles/bk-dss/handlers/main.yml b/roles/bk-dss/handlers/main.yml index 61307b4..ea1226f 100644 --- a/roles/bk-dss/handlers/main.yml +++ b/roles/bk-dss/handlers/main.yml @@ -1,10 +1,10 @@ --- -- name: Run certmgr - command: /opt/acertmgr/acertmgr.py - - name: Restart nginx service: name=nginx state=restarted - name: Restart uwsgi service: name=uwsgi state=restarted + +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py diff --git a/roles/bk-dss/meta/main.yml b/roles/bk-dss/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/bk-dss/meta/main.yml +++ b/roles/bk-dss/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/bk-dss/tasks/main.yml b/roles/bk-dss/tasks/main.yml index c0ada80..fafaea5 100644 --- a/roles/bk-dss/tasks/main.yml +++ b/roles/bk-dss/tasks/main.yml @@ -32,7 +32,7 @@ - name: Configure certificate manager template: src=certs.j2 dest=/etc/acme/domains.d/{{ dss_domain }}.conf - notify: Run certmgr + notify: Run acertmgr - name: Configure vhosts template: src=vhost.j2 dest=/etc/nginx/sites-available/dss diff --git a/roles/gogs/handlers/main.yml b/roles/gogs/handlers/main.yml index 44975c4..45972c5 100644 --- a/roles/gogs/handlers/main.yml +++ b/roles/gogs/handlers/main.yml @@ -1,4 +1,7 @@ --- +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py + - name: Restart nginx service: name=nginx state=restarted diff --git a/roles/gogs/meta/main.yml b/roles/gogs/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/gogs/meta/main.yml +++ b/roles/gogs/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/gogs/tasks/main.yml b/roles/gogs/tasks/main.yml index 782be71..6721155 100644 --- a/roles/gogs/tasks/main.yml +++ b/roles/gogs/tasks/main.yml @@ -34,6 +34,7 @@ - name: Configure certificate manager for gogs template: src=certs.j2 dest=/etc/acme/domains.d/{{ gogs_domain }}.conf + notify: Run acertmgr - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/gogs diff --git a/roles/hackmd/handlers/main.yml b/roles/hackmd/handlers/main.yml index cde90a7..b9eb0c1 100644 --- a/roles/hackmd/handlers/main.yml +++ b/roles/hackmd/handlers/main.yml @@ -8,3 +8,6 @@ - name: Restart nginx service: name=nginx state=restarted + +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py diff --git a/roles/hackmd/meta/main.yml b/roles/hackmd/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/hackmd/meta/main.yml +++ b/roles/hackmd/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/hackmd/tasks/main.yml b/roles/hackmd/tasks/main.yml index 8adc2f4..02b0de0 100644 --- a/roles/hackmd/tasks/main.yml +++ b/roles/hackmd/tasks/main.yml @@ -72,6 +72,7 @@ - name: Configure certificate manager for hackmd template: src=certs.j2 dest=/etc/acme/domains.d/{{ hackmd_domain }}.conf + notify: Run acertmgr - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/hackmd diff --git a/roles/librenms/handlers/main.yml b/roles/librenms/handlers/main.yml index 44975c4..2c3a4e3 100644 --- a/roles/librenms/handlers/main.yml +++ b/roles/librenms/handlers/main.yml @@ -2,3 +2,6 @@ - name: Restart nginx service: name=nginx state=restarted + +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py diff --git a/roles/librenms/meta/main.yml b/roles/librenms/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/librenms/meta/main.yml +++ b/roles/librenms/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/librenms/tasks/main.yml b/roles/librenms/tasks/main.yml index 0244196..dedb328 100644 --- a/roles/librenms/tasks/main.yml +++ b/roles/librenms/tasks/main.yml @@ -60,6 +60,7 @@ - name: Configure certificate manager for librenms template: src=certs.j2 dest=/etc/acme/domains.d/{{ librenms_domain }}.conf + notify: Run acertmgr - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/librenms diff --git a/roles/mail/handlers/main.yml b/roles/mail/handlers/main.yml index a477169..49b03bd 100644 --- a/roles/mail/handlers/main.yml +++ b/roles/mail/handlers/main.yml @@ -15,6 +15,9 @@ - name: Restart postgrey service: name=postgrey state=restarted +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py + - name: Run postmap command: postmap /etc/{{ item }} with_items: diff --git a/roles/mail/meta/main.yml b/roles/mail/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/mail/meta/main.yml +++ b/roles/mail/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml index daeb38f..3381f28 100644 --- a/roles/mail/tasks/main.yml +++ b/roles/mail/tasks/main.yml @@ -144,9 +144,11 @@ - name: Configure certificate manager template: src=certs.j2 dest=/etc/acme/domains.d/{{ mail_server }}_mail.conf + notify: Run acertmgr - name: Configure certificate manager for mailman template: src=mailman/certs.j2 dest=/etc/acme/domains.d/{{ mailman_domain }}_mailman.conf + notify: Run acertmgr - name: Start amavis service: name=amavis state=started enabled=yes diff --git a/roles/owncloud/meta/main.yml b/roles/owncloud/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/owncloud/meta/main.yml +++ b/roles/owncloud/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/owncloud/tasks/main.yml b/roles/owncloud/tasks/main.yml index 34f63a3..5aa5a16 100644 --- a/roles/owncloud/tasks/main.yml +++ b/roles/owncloud/tasks/main.yml @@ -32,6 +32,7 @@ - name: Configure certificate manager for owncloud template: src=certs.j2 dest=/etc/acme/domains.d/{{ owncloud_domain }}.conf + notify: Run acertmgr - name: Create vhost directory file: path=/var/www/owncloud state=directory owner=www-data group=www-data diff --git a/roles/partdb/handlers/main.yml b/roles/partdb/handlers/main.yml index 9735dcd..2c3a4e3 100644 --- a/roles/partdb/handlers/main.yml +++ b/roles/partdb/handlers/main.yml @@ -3,5 +3,5 @@ - name: Restart nginx service: name=nginx state=restarted -- name: Run certmgr +- name: Run acertmgr command: /opt/acertmgr/acertmgr.py diff --git a/roles/partdb/meta/main.yml b/roles/partdb/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/partdb/meta/main.yml +++ b/roles/partdb/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/partdb/tasks/main.yml b/roles/partdb/tasks/main.yml index 68a7a89..670aea1 100644 --- a/roles/partdb/tasks/main.yml +++ b/roles/partdb/tasks/main.yml @@ -17,7 +17,7 @@ - name: Configure certificate manager copy: src=certs dest=/etc/acme/domains.d/partdb.binary-kitchen.de.conf - notify: Run certmgr + notify: Run acertmgr - name: Configure vhosts copy: src=vhost dest=/etc/nginx/sites-available/www diff --git a/roles/prosody/handlers/main.yml b/roles/prosody/handlers/main.yml index 08cb4f8..4aed870 100644 --- a/roles/prosody/handlers/main.yml +++ b/roles/prosody/handlers/main.yml @@ -5,3 +5,6 @@ - name: Restart prosody service: name=prosody state=restarted + +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py diff --git a/roles/prosody/meta/main.yml b/roles/prosody/meta/main.yml index 7786a89..a456842 100644 --- a/roles/prosody/meta/main.yml +++ b/roles/prosody/meta/main.yml @@ -1,4 +1,4 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } diff --git a/roles/prosody/tasks/main.yml b/roles/prosody/tasks/main.yml index 7c088d4..0b676ab 100644 --- a/roles/prosody/tasks/main.yml +++ b/roles/prosody/tasks/main.yml @@ -33,6 +33,7 @@ - name: Configure certificate manager template: src=certs.j2 dest=/etc/acme/domains.d/{{ prosody_domain }}_prosody.conf + notify: Run acertmgr - name: Start saslauthd service: name=saslauthd state=started enabled=yes diff --git a/roles/racktables/handlers/main.yml b/roles/racktables/handlers/main.yml index 44975c4..2c3a4e3 100644 --- a/roles/racktables/handlers/main.yml +++ b/roles/racktables/handlers/main.yml @@ -2,3 +2,6 @@ - name: Restart nginx service: name=nginx state=restarted + +- name: Run acertmgr + command: /opt/acertmgr/acertmgr.py diff --git a/roles/racktables/meta/main.yml b/roles/racktables/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/racktables/meta/main.yml +++ b/roles/racktables/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/racktables/tasks/main.yml b/roles/racktables/tasks/main.yml index d26c8f4..16e474a 100644 --- a/roles/racktables/tasks/main.yml +++ b/roles/racktables/tasks/main.yml @@ -39,6 +39,7 @@ - name: Configure certificate manager for racktables template: src=certs.j2 dest=/etc/acme/domains.d/{{ racktables_domain }}.conf + notify: Run acertmgr - name: Configure vhost template: src=vhost.j2 dest=/etc/nginx/sites-available/racktables diff --git a/roles/web/handlers/main.yml b/roles/web/handlers/main.yml index 9735dcd..2c3a4e3 100644 --- a/roles/web/handlers/main.yml +++ b/roles/web/handlers/main.yml @@ -3,5 +3,5 @@ - name: Restart nginx service: name=nginx state=restarted -- name: Run certmgr +- name: Run acertmgr command: /opt/acertmgr/acertmgr.py diff --git a/roles/web/meta/main.yml b/roles/web/meta/main.yml index 8d2c010..8fcf724 100644 --- a/roles/web/meta/main.yml +++ b/roles/web/meta/main.yml @@ -1,5 +1,5 @@ --- dependencies: -- { role: certmgr } +- { role: acertmgr } - { role: nginx, nginx_ssl: True } diff --git a/roles/web/tasks/main.yml b/roles/web/tasks/main.yml index 7a3bb3f..8d92dc3 100644 --- a/roles/web/tasks/main.yml +++ b/roles/web/tasks/main.yml @@ -25,7 +25,7 @@ - name: Configure certificate manager copy: src=certs dest=/etc/acme/domains.d/www.binary-kitchen.de.conf - notify: Run certmgr + notify: Run acertmgr - name: Configure vhosts copy: src=vhost dest=/etc/nginx/sites-available/www