diff --git a/group_vars/all/01_mode.yml b/group_vars/all/01_modes.yml similarity index 88% rename from group_vars/all/01_mode.yml rename to group_vars/all/01_modes.yml index f72347c8..aedbf74e 100644 --- a/group_vars/all/01_mode.yml +++ b/group_vars/all/01_modes.yml @@ -6,4 +6,5 @@ mode_debug: false # Prints well formated debug information mode_test: false # Executes test routines instead of productive routines mode_update: true # Executes updates mode_backup: true # Activates the backup before the update procedure -mode_setup: false # Execute the setup and initializing procedures \ No newline at end of file +mode_setup: false # Execute the setup and initializing procedures +mode_cleanup: false # Cleanup unused files and configurations \ No newline at end of file diff --git a/tasks/recieve-certbot-certificate.yml b/tasks/recieve-certbot-certificate.yml index 71894346..83740e82 100644 --- a/tasks/recieve-certbot-certificate.yml +++ b/tasks/recieve-certbot-certificate.yml @@ -12,6 +12,12 @@ {{ '--test-cert' if mode_test | bool else '' }} when: enable_one_letsencrypt_cert_for_all and run_once_recieve_certificate is not defined +- name: "cleanup dedicated cert for {{ domain }}" + command: >- + certbot delete --cert-name {{ domain }} --non-interactive + when: mode_cleanup and enable_one_letsencrypt_cert_for_all and run_once_recieve_certificate is not defined + + - name: run the recieve_certificate tasks once set_fact: run_once_recieve_certificate: true