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:
parent
38eaa43d04
commit
6c9e085cbd
1 changed files with 11 additions and 0 deletions
|
|
@ -53,6 +53,13 @@
|
||||||
dest: "{{ stack_root }}/"
|
dest: "{{ stack_root }}/"
|
||||||
delete: false
|
delete: false
|
||||||
recursive: true
|
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:
|
rsync_opts:
|
||||||
- "--exclude=.git"
|
- "--exclude=.git"
|
||||||
- "--exclude=config/"
|
- "--exclude=config/"
|
||||||
|
|
@ -62,6 +69,9 @@
|
||||||
- "--exclude=.env"
|
- "--exclude=.env"
|
||||||
- "--exclude=wireguard/wg0.conf"
|
- "--exclude=wireguard/wg0.conf"
|
||||||
- "--exclude=ansible/.vault_pass"
|
- "--exclude=ansible/.vault_pass"
|
||||||
|
- "--no-owner"
|
||||||
|
- "--no-group"
|
||||||
|
- "--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r"
|
||||||
when: deploy_stack_files | bool
|
when: deploy_stack_files | bool
|
||||||
become: false
|
become: false
|
||||||
tags: [stack, deploy]
|
tags: [stack, deploy]
|
||||||
|
|
@ -74,6 +84,7 @@
|
||||||
group: "{{ stack_group }}"
|
group: "{{ stack_group }}"
|
||||||
recurse: true
|
recurse: true
|
||||||
when: deploy_stack_files | bool
|
when: deploy_stack_files | bool
|
||||||
|
# become: true from play — can reset root-owned files from containers
|
||||||
tags: [stack, deploy]
|
tags: [stack, deploy]
|
||||||
|
|
||||||
- name: Deploy production .env for this host
|
- name: Deploy production .env for this host
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue