---

- name: Update APT cache
  apt: update_cache=yes cache_valid_time=3600
  when: ansible_os_family == "Debian"

- name: Install packages (apt)
  apt: pkg={{ item }}
  with_flattened:
    - all_packages
    - group_packages
    - host_packages
  when: ansible_os_family == "Debian"

- name: Install packages (yum)
  yum: pkg={{ item }}
  with_flattened:
    - all_packages
    - group_packages
    - host_packages
  when: ansible_os_family == "RedHat"

---

- name: Update APT cache
  apt: update_cache=yes cache_valid_time=3600
  when: ansible_os_family == "Debian"

- name: Install packages (apt)
  apt: pkg={{ item }}
  with_flattened:
    - all_packages
    - group_packages
    - host_packages
  when: ansible_os_family == "Debian"

- name: Install packages (yum)
  yum: pkg={{ item }}
  with_flattened:
    - all_packages
    - group_packages
    - host_packages
  when: ansible_os_family == "RedHat"

- name: Install packages (pkgin)
  pkgin: pkg={{ item }}
  with_flattened:
    - all_packages
    - group_packages
    - host_packages
  when: ansible_distribution == "SmartOS"

Install packages with pkgin on SmartOS
Install packages with pkgin on SmartOS
