Commit 373dafd
Stop the apt repository tasks undoing each other every run
"Remove old PowerDNS repository files" deleted
/etc/apt/sources.list.d/powerdns.list, and "Add PowerDNS repository" recreated
it immediately afterwards through apt_repository's filename: powerdns. So both
reported changed on every deploy, forever, and a repeat run of an unchanged
playbook never settled to zero.
The removal did have a point. apt_repository adds a repository line but will not
remove a superseded one, so moving auth_version - 4.9 to 5.0, as happened
recently - would leave the old suite sitting in the same file and still enabled.
Deleting the file first was the way to guarantee it held only the current line.
Declaring the content directly gets that guarantee without the churn: the file
is exactly one line by construction, and a changed auth_version rewrites it
rather than appending to it. The rendered content is byte-identical to what is
on the hosts today, so this settles immediately instead of costing one more
transitional change.
The legacy filename apt_repository generated before it was given an explicit one
is still removed, which is idempotent now that it is the only path in the task.
Also stops cache_valid_time hiding a repository change: at 86400 the refresh
could be skipped for up to a day after the line moved, and the pinned version
would then simply not be found in the stale index. The window now collapses to
zero when the repository file actually changed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 95cab94 commit 373dafd
1 file changed
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | | - | |
| 65 | + | |
62 | 66 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
67 | 74 | | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
72 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
73 | 90 | | |
74 | 91 | | |
75 | 92 | | |
76 | | - | |
| 93 | + | |
77 | 94 | | |
78 | 95 | | |
79 | 96 | | |
| |||
0 commit comments