Beginning-Ansible-Concepts-.../chapter07/upgrade.yml

16 lines
272 B
YAML
Raw Normal View History

2022-03-21 18:17:54 +01:00
---
- 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