Changeset 16460 for main/waeup-ansible


Ignore:
Timestamp:
15 Apr 2021, 08:17:26 (4 years ago)
Author:
uli
Message:

Also apt autoremove after package changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup-ansible/playbook-daily-upgrade.yml

    r15572 r16460  
    1 # Run 'aptitude safe-upgrade' on all registered hosts.
     1# Daily package maintenance
    22#
    3 # The output of each update is appended to `myfineupdate.log`, a locally
    4 # created file.
     3# Run 'aptitude safe-upgrade' on all registered hosts followed by
     4# apt-autoremove
    55#
    66# Run like:
     
    1313  tasks:
    1414  - name: safe-upgrade
    15     ignore_errors: true
     15    # ignore_errors: true
    1616    register: upgrade
    1717    apt:
    1818        update_cache: yes
    1919        upgrade: safe
    20   - name: "log-to myfineupdate.log"
    21     local_action: shell echo "{{ inventory_hostname }}:"" ----- `date --rfc-3339=seconds`\n  {{ '\n  '.join(upgrade.stdout_lines) }}  {{ '\n  '.join(upgrade.stderr_lines) }}" >> "myfineupdate.log"
    22     become: false
    23     changed_when: false
     20  - name: autoremove-old-pkgs
     21    apt:
     22        autoremove: yes
     23    when:
     24        upgrade.changed
Note: See TracChangeset for help on using the changeset viewer.