Changeset 14985


Ignore:
Timestamp:
11 Apr 2018, 08:45:44 (7 years ago)
Author:
uli
Message:

Log daily upgrade changes to file.

The daily-upgrade playbook output was already nice for a quick overview: on
which hosts there were chenges and on which ones not? But when changes
happened, we had to look into the respective machines to see which packages
were affected. With the new locally created logfile, we can much quicker access
these infos.

File:
1 edited

Legend:

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

    r14982 r14985  
     1# Run 'aptitude safe-upgrade' on all registered hosts.
     2#
     3# The output of each update is appended to `myfineupdate.log`, a locally
     4# created file.
     5#
     6# Run like:
     7#
     8#   $ ansible-playbook -i hosts playbook-daily-upgrade.yml
     9#
    110- hosts: all
    211  become: true
     
    413  tasks:
    514  - name: safe-upgrade
     15    register: upgrade
    616    apt:
    717        update_cache: yes
    818        upgrade: safe
     19  - name: "log-to myfineupdate.log"
     20    local_action: shell echo "{{ inventory_hostname }}:\n  {{ '\n  '.join(upgrade.stdout_lines) }}  {{ '\n  '.join(upgrade.stderr_lines) }}" >> "myfineupdate.log"
     21    become: false
     22    changed_when: false
Note: See TracChangeset for help on using the changeset viewer.