ansible: fix ci-instances playbook for Incus
[lttng-ci.git] / automation / ansible / playbooks / dist-upgrade.yml
... / ...
CommitLineData
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 update && apt dist-upgrade && apt clean && apt autoremove --purge"
16 ansible.builtin.apt:
17 update_cache: yes
18 cache_valid_time: 3600
19 upgrade: dist
20 clean: yes
21 autoremove: yes
22 purge: yes
23
24 - name: "Reboot server"
25 command: /sbin/reboot
26 async: 0
27 poll: 0
28 ignore_errors: true
29 when: reboot == "yes"
30 register: last_result
31
32 - name: wait for the server to reboot
33 local_action: wait_for host={{ inventory_hostname }}
34 port=22
35 delay=1
36 timeout=300
37 state=started
38 when: last_result.changed
39 become: false
This page took 0.023 seconds and 5 git commands to generate.