Deploys always pull images; dockcheck recreates only what it updated

Compose deploys used the default pull policy (missing), so switching a
service to a tag that was already cached deployed a year-old image
(paperless-ngx and heyform :latest). module_defaults now sets pull: always
for every docker_compose_v2 task.

dockcheck pulls the image it updates, but then ran compose up for the
whole stack, which could recreate other containers in the stack from
cached images, including ones it excludes. OnlySpecific=true limits it to
the updated container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-09 20:35:50 -07:00
1 parent 58cbdf39f7
commit c9506e2db0
3 files changed
+12

No files matched your search

+1
View File
@@ -112,6 +112,7 @@ Never hardcode domains, IPs or secrets in templates; use these variables.
- Public access: subdomain in `domains.yml`, route in `Caddyfile.j2`, A record in `dns.yml`. - Public access: subdomain in `domains.yml`, route in `Caddyfile.j2`, A record in `dns.yml`.
- Use `diff: false` / `no_log: true` on tasks that write secrets. - Use `diff: false` / `no_log: true` on tasks that write secrets.
- Add the label `mag37.dockcheck.update: true` if dockcheck may update it unattended. - Add the label `mag37.dockcheck.update: true` if dockcheck may update it unattended.
- Deploys pull every image fresh (`pull: always` in `site.yml` module_defaults), so a `latest` tag deploys the current release. A deploy therefore also upgrades anything on a floating tag; pin `<service>_version` to hold it.
### DNS ### DNS
`dns.yml` manages Route53 A records for both domains with a Route53-only IAM `dns.yml` manages Route53 A records for both domains with a Route53-only IAM
+5
View File
@@ -37,6 +37,11 @@ MonoMode=true
# Add release-note links (from urls.list) to each update listed # Add release-note links (from urls.list) to each update listed
PrintReleaseURL=true PrintReleaseURL=true
# Recreate only the container that was updated, not its whole compose stack.
# Otherwise the stack's other containers (excluded or unlabelled ones too)
# get recreated from whatever image is cached locally.
OnlySpecific=true
# Exclude containers from checking # Exclude containers from checking
Exclude="dawarich_redis,dawarich_db" Exclude="dawarich_redis,dawarich_db"
+6
View File
@@ -2,6 +2,12 @@
- hosts: docker - hosts: docker
become: true become: true
# Always fetch each image tag from the registry before compose up. The
# default only pulls missing images, so a tag that was already cached (say
# :latest from a year ago) got deployed as-is.
module_defaults:
community.docker.docker_compose_v2:
pull: always
roles: roles:
- { role: common, tags: ["common"] } - { role: common, tags: ["common"] }
- { role: docker, tags: ["docker"] } - { role: docker, tags: ["docker"] }