Beginning-Ansible-Concepts-.../chapter06/upgrade.yml
2022-04-23 08:57:49 +01:00

15 lines
272 B
YAML

---
- hosts: web-001.local
gather_facts: no
become: true
tasks:
- name: Upgrade all packages
apt:
upgrade: dist
update_cache: yes
register: upgrade_result
- name: Reboot the host
reboot:
when: upgrade_result.changed