Skip to content
Snippets Groups Projects
Commit cd3d355f authored by nimrod's avatar nimrod
Browse files

Daily background updates for Debian systems.

parent cf68c56a
No related branches found
No related tags found
No related merge requests found
Pipeline #864 passed
#!/bin/sh
set -eu
apt-get update
apt-get dist-upgrade --download-only --yes
apt-get autoclean
if command -v flatpak >/dev/null 2>&1
then
flatpak --system update --appstream
flatpak --system update --assumeyes
flatpak --system uninstall --unused --assumeyes
fi
[Unit]
Description=Background system updates
ConditionACPower=true
After=network-online.target
[Service]
Type=oneshot
ExecStart=daily
[Unit]
Description=Background system updates
[Timer]
OnCalendar=daily
[Install]
WantedBy=multi-user.target
...@@ -208,3 +208,36 @@ ...@@ -208,3 +208,36 @@
mode: preserve mode: preserve
owner: root owner: root
src: btrfs-backup src: btrfs-backup
- name: Mail aliases
loop:
- root
- nimrod
ansible.builtin.lineinfile:
backup: true
create: true
line: '{{ item }}: {{ item }}@shore.co.il'
path: /etc/aliases
regexp: '^{{ item }}:'
state: present
- name: Copy update script
ansible.builtin.copy:
dest: /usr/local/sbin/daily
mode: 0o0755
src: daily
- name: Copy update service and timer
loop:
- update.service
- update.timer
ansible.builtin.copy:
dest: /etc/systemd/system
mode: 0o0644
src: '{{ item }}'
- name: Enable the update timer
ansible.builtin.systemd:
enabled: true
name: update.timer
state: started
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment