Skip to content

Instantly share code, notes, and snippets.

@ZeroDeth
Created August 11, 2017 02:28
Show Gist options
  • Save ZeroDeth/8916eb7599bbfea2d68869e6522ba76b to your computer and use it in GitHub Desktop.
Save ZeroDeth/8916eb7599bbfea2d68869e6522ba76b 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