File tree Expand file tree Collapse file tree 5 files changed +14
-0
lines changed
roles/unattended_upgrades Expand file tree Collapse file tree 5 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 88# handlers file for unattended-upgrades
99
1010- name : ' Restart apt-daily timer'
11+ become : true
1112 ansible.builtin.systemd :
1213 daemon_reload : true
1314 name : ' apt-daily.timer'
1415 state : ' restarted'
1516 enabled : true
1617
1718- name : ' Restart apt-daily-upgrade timer'
19+ become : true
1820 ansible.builtin.systemd :
1921 daemon_reload : true
2022 name : ' apt-daily-upgrade.timer'
Original file line number Diff line number Diff line change 88# Ignored, since newer distros don't need this package
99# https://github.com/jnv/ansible-role-unattended-upgrades/issues/6
1010- name : " Install update-notifier-common"
11+ become : true
1112 ansible.builtin.apt :
1213 name : " update-notifier-common"
1314 state : " present"
Original file line number Diff line number Diff line change 66---
77
88- name : ' Test apt-daily timer expression'
9+ become : true
910 ansible.builtin.command :
1011 cmd : ' systemd-analyze calendar "{{ unattended_apt_daily_oncalendar }}"'
1112 register : ' __apt_daily'
1213 changed_when : ' __apt_daily.rc != 0'
1314 check_mode : false
1415
1516- name : ' Test apt-daily-upgrade timer expression'
17+ become : true
1618 ansible.builtin.command :
1719 cmd : ' systemd-analyze calendar "{{ unattended_apt_daily_upgrade_oncalendar }}"'
1820 register : ' __apt_daily_upgrade'
1921 changed_when : ' __apt_daily_upgrade.rc != 0'
2022 check_mode : false
2123
2224- name : ' Ensure directory apt-daily.timer.d exists'
25+ become : true
2326 ansible.builtin.file :
2427 path : ' /etc/systemd/system/apt-daily.timer.d'
2528 mode : ' 0755'
2831 group : ' root'
2932
3033- name : ' Ensure directory apt-daily-upgrade.timer.d exists'
34+ become : true
3135 ansible.builtin.file :
3236 path : ' /etc/systemd/system/apt-daily-upgrade.timer.d'
3337 mode : ' 0755'
3640 group : ' root'
3741
3842- name : ' Deploy apt-daily timer'
43+ become : true
3944 ansible.builtin.template :
4045 src : ' apt_daily_override.conf.j2'
4146 dest : ' /etc/systemd/system/apt-daily.timer.d/schedule_override.conf'
4853 - ' Restart apt-daily timer'
4954
5055- name : ' Deploy apt-daily-upgrade timer'
56+ become : true
5157 ansible.builtin.template :
5258 src : ' apt_daily_upgrade_override.conf.j2'
5359 dest : ' /etc/systemd/system/apt-daily-upgrade.timer.d/schedule_override.conf'
Original file line number Diff line number Diff line change 66---
77
88- name : ' Remove apt-daily timer override'
9+ become : true
910 ansible.builtin.file :
1011 path : ' /etc/systemd/system/apt-daily.timer.d/schedule_override.conf'
1112 state : ' absent'
1213 notify :
1314 - ' Restart apt-daily timer'
1415
1516- name : ' Remove apt-daily-upgrade timer override'
17+ become : true
1618 ansible.builtin.file :
1719 path : ' /etc/systemd/system/apt-daily-upgrade.timer.d/schedule_override.conf'
1820 state : ' absent'
Original file line number Diff line number Diff line change 1616 - ' vars'
1717
1818- name : " Install powermgmt-base"
19+ become : true
1920 ansible.builtin.apt :
2021 name : " powermgmt-base"
2122 state : " present"
2526 when : " unattended_only_on_ac_power"
2627
2728- name : " Install unattended-upgrades"
29+ become : true
2830 ansible.builtin.apt :
2931 name : " unattended-upgrades"
3032 state : " present"
3739 when : " unattended_automatic_reboot | bool"
3840
3941- name : " Create Apt auto-upgrades & unattended-upgrades configuration"
42+ become : true
4043 ansible.builtin.template :
4144 src : " unattended-upgrades.j2"
4245 dest : " /etc/apt/apt.conf.d/90-ansible-unattended-upgrades"
You can’t perform that action at this time.
0 commit comments