EXAMPLE: 1
- hosts: all
gather_facts: yes
remote_user: craun
serial: "50%"
sudo: yes
tasks:
- name: Update Shellshock (Debian)
apt: name=bash
state=latest
update_cache=yes
when: ansible_os_family == "Debian"
- name: Update Shellshock (RedHat)
yum: name=bash
state=latest
update_cache=yes
when: ansible_os_family == "RedHat"
EXAMPLE: 2
- hosts: all
gather_facts: yes
remote_user: craun
serial: "25%"
sudo: yes
tasks:
- name: Update OpenSSL and OpenSSH (Debian)
apt: name={{ item }}
state=latest
update_cache=yes
with_items:
- openssl
- openssh-client
- openssh-server
when: ansible_os_family == "Debian"
- name: Update OpenSSL and OpenSSH (RedHat)
yum: name={{ item }}
state=latest
update_cache=yes
with_items:
- openssl
- openssh-client
- openssh-server
when: ansible_os_family == "RedHat"
post_tasks:
- name: Reboot servers
command: reboot