Skip to content

Instantly share code, notes, and snippets.

@andrzejressel
Created November 24, 2021 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrzejressel/6cfeb1325cc65da46f18e2f20c54af6b to your computer and use it in GitHub Desktop.
Save andrzejressel/6cfeb1325cc65da46f18e2f20c54af6b to your computer and use it in GitHub Desktop.
Simple Ansible playbook for updating linux machines
---
- 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