-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makes unattended-upgrades sequencing more similar to cron-apt #5855
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a98e91c
Adjust timing of daily apt tasks
rmol 34fdc7a
Configures apt timers via Ansible
bddeb5e
Sets unattended-upgrades reboot time to "now"
a083a52
Fixes confold, confdef in unattended-upgrades
1bc7452
Updates testinfra tests for unattended-upgrades
b349d71
Add explicit enable for periodic apt updates.
zenmonkeykstop 74fadb8
Sets unattended-upgrades reboot time to daily_reboot_time
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,7 @@ | |
- name: update apt cache | ||
apt: | ||
update_cache: yes | ||
|
||
- name: systemd daemon-reload | ||
systemd: | ||
daemon_reload: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,24 @@ | |
# Configuration for unattended upgrades is almost exclusively managed by the | ||
# securedrop-config package under Focal. | ||
|
||
- name: Create override dirs for apt-daily timers | ||
file: | ||
state: directory | ||
mode: "0755" | ||
path: "{{ item.dest|dirname }}" | ||
with_items: "{{ unattended_upgrades_timer_overrides }}" | ||
|
||
- name: Add overrides for apt-daily timers | ||
template: | ||
src: "{{ item.src }}" | ||
dest: "{{ item.dest }}" | ||
mode: "0644" | ||
notify: systemd daemon-reload | ||
with_items: "{{ unattended_upgrades_timer_overrides }}" | ||
|
||
# Ensure daemon-reload has happened before starting/enabling | ||
- meta: flush_handlers | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
- name: Ensure apt-daily and apt-daily-upgrade services are unmasked, started and enabled. | ||
systemd: | ||
name: "{{ item }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
install_files/ansible-base/roles/common/templates/apt-daily-timer-override.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[Timer] | ||
OnCalendar= | ||
OnCalendar=*-*-* {{ daily_update_time }}:00 | ||
RandomizedDelaySec=20m | ||
Persistent=true |
4 changes: 4 additions & 0 deletions
4
install_files/ansible-base/roles/common/templates/apt-daily-upgrade-timer-override.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[Timer] | ||
OnCalendar= | ||
OnCalendar=*-*-* {{ daily_upgrade_time }}:00 | ||
RandomizedDelaySec=20m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,5 +62,7 @@ Unattended-Upgrade::Automatic-Reboot-WithUsers "true"; | |
// Here we set the dpkg options to force the old conffile if it's already present | ||
// or force the default config if no config is present | ||
// see https://github.com/freedomofpress/securedrop/pull/911 | ||
Dpkg::Options "force-confdef"; | ||
Dpkg::Options "force-confold"; | ||
Dpkg::Options { | ||
"--force-confdef"; | ||
"--force-confold"; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's the change that will re-close #5849. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially i thought this was a template block but it's just declaring the variables 👍