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