From 7d8f4f2c9526db6a26d7beccf6be151845fb77b3 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 29 Dec 2025 03:00:24 +0300 Subject: [PATCH] Feat(playbooks/logcheck): Update ignore files faster Use `synchronize` - it updates multiple files much faster. --- playbooks/logcheck.sh | 1 + playbooks/roles/logcheck/tasks/main.yaml | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/playbooks/logcheck.sh b/playbooks/logcheck.sh index 05a9d09..f77f348 100755 --- a/playbooks/logcheck.sh +++ b/playbooks/logcheck.sh @@ -8,5 +8,6 @@ if ! git diff-index --quiet HEAD || test -n "`git ls-files --others`" ; then exit 1 fi +chmod u=rw,g=r,o= roles/logcheck/files/ignore.d/local-* (cd ../.. && exec distribute -aD ansible) exec ./run-playbook logcheck.yaml diff --git a/playbooks/roles/logcheck/tasks/main.yaml b/playbooks/roles/logcheck/tasks/main.yaml index c9ae5fc..0034afe 100644 --- a/playbooks/roles/logcheck/tasks/main.yaml +++ b/playbooks/roles/logcheck/tasks/main.yaml @@ -41,12 +41,14 @@ - name: Update logcheck ignore files become: true - copy: + ansible.posix.synchronize: src: "{{ ansible_facts.user_dir }}/admin/ansible/playbooks/roles/logcheck/files/ignore.d/" - remote_src: true dest: "/etc/logcheck/ignore.d.{{ item }}" - owner: root - group: logcheck - directory_mode: 'u=rwx,g=rx,o=' - mode: 'u=rw,g=r,o=' + archive: no # avoid setting owner/group + recursive: no + delete: no + perms: yes + times: yes + rsync_opts: '--chown=root:logcheck' + delegate_to: "{{ inventory_hostname }}" loop: ['server', 'workstation'] -- 2.47.3