From fff91c2995bb71e432eeee5b989baa78ebc4160c Mon Sep 17 00:00:00 2001 From: David Kilias Date: Sun, 7 Feb 2021 12:58:06 +0100 Subject: [PATCH] move some tasks to handlers --- roles/dehydrated/handlers/main.yml | 6 ++++++ roles/dehydrated/tasks/main.yml | 10 +--------- 2 files changed, 7 insertions(+), 9 deletions(-) create mode 100644 roles/dehydrated/handlers/main.yml diff --git a/roles/dehydrated/handlers/main.yml b/roles/dehydrated/handlers/main.yml new file mode 100644 index 0000000..5875423 --- /dev/null +++ b/roles/dehydrated/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: dehydrated register + command: "{{ dehydrated_path }} --register --accept-terms" + +- name: dehydrated cron + command: "{{ dehydrated_path }} --cron" \ No newline at end of file diff --git a/roles/dehydrated/tasks/main.yml b/roles/dehydrated/tasks/main.yml index cd3afa0..ef5078f 100644 --- a/roles/dehydrated/tasks/main.yml +++ b/roles/dehydrated/tasks/main.yml @@ -24,18 +24,10 @@ ansible.builtin.template: src: /templates/config.j2 dest: "{{ dehydrated_config }}/config" - register: dehyconfig + notify: dehydrated register - name: Create wellknown directory. file: state: directory path: /var/www/letsencrypt - -- name: Register account. - command: "{{ dehydrated_path }} --register --accept-terms" - when: dehyconfig.changed - -- name: Initial dehydrated run. - command: "{{ dehydrated_path }} --cron" - when: dehyconfig.changed \ No newline at end of file