Skip to content

Instantly share code, notes, and snippets.

@allanice001
Created June 19, 2017 09:41
Show Gist options
  • Save allanice001/2918590bb4c3018db111f99b4469097c to your computer and use it in GitHub Desktop.
Save allanice001/2918590bb4c3018db111f99b4469097c to your computer and use it in GitHub Desktop.
Upgrade playbook for RedHat and Debian type hosts
---
- hosts: all
become: yes
tasks:
- name: Update packages list (apt)
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: Update package list (yum)
yum: update_cache=yes name=* state=latest
when: ansible_os_family == 'RedHat'
- name: Upgrade packages (apt)
apt: upgrade=safe
when: ansible_os_family == 'Debian'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment