left4me: make chown_src self-healing too
Same problem as pip_install: chown_src was triggered:True and only fired when git_deploy did. After a partial first-apply where git_deploy succeeded (extracting root-owned files) but the chown didn't happen yet, subsequent applies left files root-owned forever — pip_install fails with "permission denied" trying to write .egg-info/. Drop triggered:True. Add an unless guard: test -z "$(find /opt/left4me/src ! -user left4me -print -quit)" i.e. skip the chown only when no non-left4me-owned file exists in the tree.
This commit is contained in:
parent
5bf95cb065
commit
9d17c69b22
1 changed files with 4 additions and 1 deletions
|
|
@ -144,8 +144,11 @@ git_deploy = {
|
|||
}
|
||||
|
||||
actions['left4me_chown_src'] = {
|
||||
# Runs every apply (cheap — chown -R on a small tree). Self-heals
|
||||
# whenever git_deploy extracts a new tarball as root-owned files.
|
||||
# Not in any triggers list so doesn't need triggered:True.
|
||||
'command': 'chown -R left4me:left4me /opt/left4me/src',
|
||||
'triggered': True,
|
||||
'unless': 'test -z "$(find /opt/left4me/src \\! -user left4me -print -quit 2>/dev/null)"',
|
||||
'cascade_skip': False,
|
||||
'needs': [
|
||||
'git_deploy:/opt/left4me/src',
|
||||
|
|
|
|||
Loading…
Reference in a new issue