Created
November 24, 2021 13:56
-
-
Save andrzejressel/6cfeb1325cc65da46f18e2f20c54af6b to your computer and use it in GitHub Desktop.
Simple Ansible playbook for updating linux machines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: Update package information | |
apt: | |
update_cache: true | |
- name: Upgrade the OS | |
apt: | |
upgrade: dist | |
register: apt | |
- name: Reboot | |
reboot: | |
post_reboot_delay: 15 | |
when: apt.changed | |
throttle: 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment