From e5e11271224f210c50e8643162be6b9cce860f5f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Tue, 10 Nov 2020 17:23:44 +1100 Subject: [PATCH] Add delete to synchronize Since I53cb63ffa4ae50575d4fa37b24323ad13ec1bac3 some puppet runs are failing because system-config:playbooks/roles/set-hostname moved to roles/set-hostname and became a symlink. rsync refuses to overwrite the directory with a symlink because it seems to not be empty, because we never removed the files in it. Handle the possibility of things moving around like this by specifying delete so old files are cleared out. Finally set manifest_base dir ownership and mode to address linter E208. Depends-On: https://review.opendev.org/762181 Change-Id: I249d713214d8383a3ccfe1a400404cbdcb97dcc6 --- tasks/main.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tasks/main.yaml b/tasks/main.yaml index 0b7ebcb..1ceafa0 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -77,12 +77,16 @@ - name: Ensure target directory exists file: path: "{{ manifest_base }}" + owner: root + group: root + mode: 0755 state: directory - name: copy puppet modules synchronize: src: "{{ mgmt_manifestpath }}" dest: "{{ manifest_base }}" + delete: yes no_log: "{{ puppet_nolog_sync | bool }}" - name: ensure hieradata manifest link is present @@ -117,6 +121,7 @@ synchronize: src: "{{ mgmt_puppet_module_dir }}" dest: "{{ puppet_module_dir }}" + delete: yes no_log: "{{ puppet_nolog_sync | bool }}" when: