From af11dfd513fe0cd82b9aa2303d62ce477a410653 Mon Sep 17 00:00:00 2001 From: David Kilias Date: Mon, 1 Feb 2021 20:57:41 +0100 Subject: [PATCH] remaining tasks --- roles/dehydrated/tasks/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/roles/dehydrated/tasks/main.yml b/roles/dehydrated/tasks/main.yml index 74102e6..d9523dc 100644 --- a/roles/dehydrated/tasks/main.yml +++ b/roles/dehydrated/tasks/main.yml @@ -20,8 +20,23 @@ ansible.builtin.template: src: /templates/domains.txt.j2 dest: "{{ dehydrated_config }}/domains.txt" + register: dehydomains - name: Ensure config is present. ansible.builtin.template: src: /templates/config.j2 dest: "{{ dehydrated_config }}/config" + register: dehyconfig + +- 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 or dehydomains.changed