Verified Commit 920837de authored by Marco Marinello's avatar Marco Marinello
Browse files

Add support for non-AC power unattended upgrades

refs #955
parent 07256d5b
Pipeline #206 passed with stage
in 41 seconds
# This file is part of the FUSS Client project.
# Copyright (C) 2021 The FUSS Project <info@fuss.bz.it>
# Author: Marco Marinello <contact-nohuman@marinello.bz.it>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# handlers
---
- name: reload systemd-daemon
systemd:
daemon_reload: yes
......@@ -41,3 +41,30 @@
insertafter: '"origin=Debian,codename=\$\{distro_codename\},label=Debian-Security";'
line: ' "origin=FUSS,codename=${distro_codename},label=FUSS";'
state: present
# see https://gitlab.fuss.bz.it/fuss/fuss-client/-/issues/955
# some PCs are incorrectly detected as "on ac power" and
# we want all PCs to update.
- name: Allow update on AC Power
lineinfile:
dest: /etc/apt/apt.conf.d/50unattended-upgrades
line: 'Unattended-Upgrade::OnlyOnACPower "true";'
state: present
# create override for anacron systemd unit so that it can run
# when not on ac power
- name: Create anacron service override directory
file:
path: "/etc/systemd/system/anacron.service.d"
state: directory
mode: "0755"
owner: "root"
group: "root"
notify:
- reload systemd-daemon
- name: Install anacron override on-ac.conf
copy:
content: |
[Unit]
ConditionACPower=false
dest: "/etc/systemd/system/anacron.service.d/on-ac.conf"
notify:
- reload systemd-daemon
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment