]> git.phdru.name Git - ansible.git/commitdiff
Feat(playbooks/logcheck): Update ignore files faster
authorOleg Broytman <phd@phdru.name>
Mon, 29 Dec 2025 00:00:24 +0000 (03:00 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 1 Jan 2026 00:33:42 +0000 (03:33 +0300)
Use `synchronize` - it updates multiple files much faster.

playbooks/logcheck.sh
playbooks/roles/logcheck/tasks/main.yaml

index 05a9d0914807febfa21e129cc0296069fb7e0e3f..f77f348272e111dae38809f5be84bc47e1eeb7ab 100755 (executable)
@@ -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
index c9ae5fc709f3bb3326e49076c591e11f0177f2a6..0034afe59b561574e3f6421c28fb80a0510a3ac9 100644 (file)
 
 - 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']