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

Last change on this file since 15455 was 15003, checked in by uli, 7 years ago

Put timestamp into log.

File size: 657 bytes
Line 
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#
10- hosts: all
11  become: true
12  become_user: root
13  tasks:
14  - name: safe-upgrade
15    register: upgrade
16    apt:
17        update_cache: yes
18        upgrade: safe
19  - name: "log-to myfineupdate.log"
20    local_action: shell echo "{{ inventory_hostname }}:"" ----- `date --rfc-3339=seconds`\n  {{ '\n  '.join(upgrade.stdout_lines) }}  {{ '\n  '.join(upgrade.stderr_lines) }}" >> "myfineupdate.log"
21    become: false
22    changed_when: false
Note: See TracBrowser for help on using the repository browser.