Skip to content

Instantly share code, notes, and snippets.

@tgerla
Last active August 29, 2015 14:06
Show Gist options
  • Save tgerla/6f7e20585d8f511ae4c2 to your computer and use it in GitHub Desktop.
Save tgerla/6f7e20585d8f511ae4c2 to your computer and use it in GitHub Desktop.
---
# this play queries all servers and creates groups
- hosts: all
remote_user: root
# remote_user: someuser
# sudo: true
tasks:
- name: create dynamic groups based on OS
group_by: key=ansible_os_family
# this play applies the patch only to Red Hat machines
- hosts: RedHat
remote_user: root
tasks:
- name: Update bash for RHEL/CentOS
yum: name=bash state=latest
# this play applies the patch only to Debian machines
- hosts: Debian
remote_user: root
tasks:
- name: Update bash for Ubuntu/Debian
apt: name=bash state=latest update_cache=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment