Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dreiggy/11d9586cbe8805a02e3fba59f82586c8 to your computer and use it in GitHub Desktop.
Save dreiggy/11d9586cbe8805a02e3fba59f82586c8 to your computer and use it in GitHub Desktop.
Ansible Playbook Installing System Updates for YUM and APT
---
- hosts: all
become: yes
tasks:
- name: Install system updates for centos systems
yum:
name: '*'
state: latest
update_cache: yes
#cache_valid_time: 3600
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
- name: Install system updates for ubuntu systems
apt:
name: '*'
state: latest
update_cache: yes
#cache_valid_time: 3600
when:
- ansible_os_family == "Debian"
- ansible_distribution == "Ubuntu"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment