ansible: Ignore failures when clearing history during image cleanup
[lttng-ci.git] / automation / ansible / playbooks / dist-upgrade.yml
1 ---
2 - name: Dist upgrade and optional reboot
3 hosts: all
4 vars:
5 restart: 'no'
6 reboot_wait: 300
7
8 vars_prompt:
9 - name: reboot
10 prompt: "Enter 'yes' to reboot"
11 default: 'no'
12 private: no
13
14 tasks:
15 - name: apt-get update
16 apt: update_cache=yes cache_valid_time=3600
17
18 - name: apt-get dist-upgrade
19 apt: upgrade=dist
20
21 - name: apt-get autoremove
22 command:
23 cmd: apt-get -y --purge autoremove
24 warn: false
25 register: autoremove_output
26 changed_when: "'The following packages will be REMOVED' in autoremove_output.stdout"
27
28 - name: reboot server
29 command: /sbin/reboot
30 async: 0
31 poll: 0
32 ignore_errors: true
33 when: reboot == "yes"
34 register: last_result
35
36 - name: wait for the server to reboot
37 local_action: wait_for host={{ inventory_hostname }}
38 port=22
39 delay=1
40 timeout=300
41 state=started
42 when: last_result.changed
43 become: false
This page took 0.030977 seconds and 4 git commands to generate.