Fix Ansible stack deploy rsync chgrp permission errors

Skip owner/group preservation when syncing as non-root; Docker-owned
files under /opt/stack caused rsync code 23. Ownership is fixed after.
This commit is contained in:
tim 2026-07-22 11:09:04 -07:00
parent 38eaa43d04
commit 6c9e085cbd

View file

@ -53,6 +53,13 @@
dest: "{{ stack_root }}/"
delete: false
recursive: true
# Non-root rsync cannot chown/chgrp files Docker created as root
# (e.g. searxng). Content sync only; ownership fixed in next task.
archive: true
owner: false
group: false
perms: true
times: true
rsync_opts:
- "--exclude=.git"
- "--exclude=config/"
@ -62,6 +69,9 @@
- "--exclude=.env"
- "--exclude=wireguard/wg0.conf"
- "--exclude=ansible/.vault_pass"
- "--no-owner"
- "--no-group"
- "--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r"
when: deploy_stack_files | bool
become: false
tags: [stack, deploy]
@ -74,6 +84,7 @@
group: "{{ stack_group }}"
recurse: true
when: deploy_stack_files | bool
# become: true from play — can reset root-owned files from containers
tags: [stack, deploy]
- name: Deploy production .env for this host