source: main/waeup-ansible/playbook-daily-upgrade.yml @ 17938

Last change on this file since 17938 was 16460, checked in by uli, 4 years ago

Also apt autoremove after package changes.

File size: 472 bytes
Line 
1# Daily package maintenance
2#
3# Run 'aptitude safe-upgrade' on all registered hosts followed by
4# apt-autoremove
5#
6# Run like:
7#
8#   $ ansible-playbook -i hosts playbook-daily-upgrade.yml
9#
10- hosts: all
11  become: true
12  become_user: root
13  tasks:
14  - name: safe-upgrade
15    # ignore_errors: true
16    register: upgrade
17    apt:
18        update_cache: yes
19        upgrade: safe
20  - name: autoremove-old-pkgs
21    apt:
22        autoremove: yes
23    when:
24        upgrade.changed
Note: See TracBrowser for help on using the repository browser.