From 14e09c7ee7abbb5b463788b94d19e05e2d8f8088 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Mon, 14 Sep 2026 16:53:47 +0400 Subject: [PATCH] fix(role): replaces ansible.builtin.fetch with ansible.posix.synchronize to pull the directory --- roles/update_certificates/tasks/main.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/roles/update_certificates/tasks/main.yaml b/roles/update_certificates/tasks/main.yaml index 496a6ce..dfb18f9 100644 --- a/roles/update_certificates/tasks/main.yaml +++ b/roles/update_certificates/tasks/main.yaml @@ -1,20 +1,23 @@ --- -- name: Fetch all certificates from cert-proxy - ansible.builtin.fetch: +- name: Pull directory from remote host to control node + ansible.posix.synchronize: + mode: pull src: /tmp/letsencrypt - dest: /tmp - when: "{{ inventory_hostname == 'cert-proxy' }}" + dest: /tmp + recursive: true + delete: true + when: "inventory_hostname == 'cert-proxy'" - name: Push loki.vmn.su certificate to the target ansible.builtin.copy: src: /tmp/letsencrypt/live/loki.vmn.su/fullchain.pem dest: /etc/nginx/certs/loki_fullchain.pem local_follow: true - when: "{{ inventory_hostname == 'monitoring' }}" + when: "inventory_hostname == 'monitoring'" - name: Push loki.vmn.su key to the target ansible.builtin.copy: src: /tmp/letsencrypt/live/loki.vmn.su/privkey.pem dest: /etc/nginx/certs/loki_privkey.pem local_follow: true - when: "{{ inventory_hostname == 'monitoring' }}" + when: "inventory_hostname == 'monitoring'"