---

# Root ansible playbook
- hosts: all
  tasks:
    - name: Create groups by distribution and version
      group_by: key={{ansible_distribution}}-{{ansible_distribution_version}}

    - name: Create groups by distribution
      group_by: key={{ansible_distribution}}

    - name: Create a distribution based OS family
      group_by: key={{ansible_os_family}}

- hosts: RedHat
  sudo: yes

  tasks:
    - name: upgrade all packages
      command: /usr/bin/yum -y upgrade

- hosts: Debian
  sudo: yes

  tasks:
    - apt: update_cache=yes
    - apt: upgrade=dist cache_valid_time=3600

- hosts: MacOSX
  gather_facts: no

  tasks:
    - name: update homebrew
      command: /usr/local/bin/brew update


---

# Root ansible playbook
- hosts: all
  tasks:
    - name: Create groups by distribution and version
      group_by: key={{ansible_distribution}}-{{ansible_distribution_version}}

    - name: Create groups by distribution
      group_by: key={{ansible_distribution}}

    - name: Create a distribution based OS family
      group_by: key={{ansible_os_family}}

- hosts: RedHat
  sudo: yes

  tasks:
    - name: upgrade all packages
      command: /usr/bin/yum -y upgrade

- hosts: Debian
  sudo: yes

  tasks:
    - apt: update_cache=yes
    - apt: upgrade=dist cache_valid_time=3600

- hosts: MacOSX
  gather_facts: no

  tasks:
    - command: /usr/local/bin/brew update
    - command: /usr/local/bin/brew upgrade


Update how we update OSX.
Update how we update OSX.
