The docker_stack role now creates {{ docker_stack_root }}/{{ docker_stack_name }} before copying the compose file.
The first deployment of a new stack failed because ansible.builtin.copy does not create a missing destination directory. The new task is idempotent, so existing stacks report ok. It runs as the SSH user (no become), so the directory gets the same owner as the existing stack folders.
The `docker_stack` role now creates `{{ docker_stack_root }}/{{ docker_stack_name }}` before copying the compose file.
The first deployment of a new stack failed because `ansible.builtin.copy` does not create a missing destination directory. The new task is idempotent, so existing stacks report `ok`. It runs as the SSH user (no `become`), so the directory gets the same owner as the existing stack folders.
roles/docker_stack/tasks/main.yml:13: mode: "0755" also resets the mode of stack directories that already exist, for example 0775 ones. Folders created by pi with the default umask are already 0755, no handler is notified, and removing mode would trip risky-file-permissions. Nit.
roles/docker_stack/tasks/main.yml:10: no owner/group, so the folder belongs to the SSH user, which the repo doesn't state. The copy task has the same gap. Worth setting both if become is ever added. Nit.
<!-- claude-review: pass 67addcbe1bd6a03099da235501cd300dde1dcee3 -->
## Review
Effort: medium
- `roles/docker_stack/tasks/main.yml:13`: `mode: "0755"` also resets the mode of stack directories that already exist, for example `0775` ones. Folders created by `pi` with the default umask are already `0755`, no handler is notified, and removing `mode` would trip `risky-file-permissions`. Nit.
- `roles/docker_stack/tasks/main.yml:10`: no `owner`/`group`, so the folder belongs to the SSH user, which the repo doesn't state. The copy task has the same gap. Worth setting both if `become` is ever added. Nit.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The
docker_stackrole now creates{{ docker_stack_root }}/{{ docker_stack_name }}before copying the compose file.The first deployment of a new stack failed because
ansible.builtin.copydoes not create a missing destination directory. The new task is idempotent, so existing stacks reportok. It runs as the SSH user (nobecome), so the directory gets the same owner as the existing stack folders.Review
Effort: medium
roles/docker_stack/tasks/main.yml:13:mode: "0755"also resets the mode of stack directories that already exist, for example0775ones. Folders created bypiwith the default umask are already0755, no handler is notified, and removingmodewould triprisky-file-permissions. Nit.roles/docker_stack/tasks/main.yml:10: noowner/group, so the folder belongs to the SSH user, which the repo doesn't state. The copy task has the same gap. Worth setting both ifbecomeis ever added. Nit.