Files
Ansible_plays/update_machines.yml
T
2024-08-09 05:12:50 +00:00

27 lines
627 B
YAML

---
- hosts: all
become: true
tasks:
- name: Update all servers
become: true
apt:
upgrade: dist
update_cache: yes
- name: Make sure Zypper is installed
ansible.builtin.apt:
name: "zypper"
state: installed
- name: See if pct needs a reboot
ansible.builtin.shell: "needs-restarting -r > /dev/null; echo $?"
register: needsRestarting
- name: debug
ansible.builtin.apt:
msg: "{{ needsRestarting }}"
- name: Reboot the Container
ansible.builtin.reboot:
reboot_timeout: 600
when: needsRestarting.stdout == "1"