From ca48208928f4142fbcf70d4818da7d6430d56e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Thu, 14 Apr 2022 23:43:03 +0200 Subject: [PATCH] idempotent checkout --- roles/webgateway/tasks/main.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/roles/webgateway/tasks/main.yaml b/roles/webgateway/tasks/main.yaml index 1b57c91..d07a16d 100644 --- a/roles/webgateway/tasks/main.yaml +++ b/roles/webgateway/tasks/main.yaml @@ -107,15 +107,20 @@ name: nginx state: reloaded +- name: "Remove any existing static file directories" + ansible.builtin.file: + path: "{{ item.directory }}" + state: absent + with_items: "{{ static }}" + - name: "Checkout static websites from git" ansible.builtin.git: - force: true repo: "{{ item.repo }}" dest: "{{ item.directory }}" with_items: "{{ static }}" - name: "Remove .git directory from static websites" ansible.builtin.file: - path: "{{ item.directory}}/.git" + path: "{{ item.directory }}/.git" state: absent with_items: "{{ static }}"