mirror of
https://github.com/Apress/Beginning-Ansible-Concepts-and-Application.git
synced 2024-11-09 17:07:44 +01:00
16 lines
272 B
YAML
16 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
|
||
|
|