---
- name: install build tools meta package (OmniOS)
  pkg5:
    name:
      - pkg:/developer/illumos-tools
  register: result
  until: not result|failed
  retries: 10
  delay: 60
  when: ansible_distribution == "OmniOS"

#
# Since OmniOS doesn't install the "easy_install" in any easy to find
# location (e.g. it's not in the default PATH), we add a symlink so
# later scripts and Ansible roles will be able to easily find it.
#
- name: create easy_install symlink (OmniOS)
  file:
    src: /usr/lib/python2.6/vendor-packages/easy_install
    dest: /usr/bin/easy_install
    owner: root
    group: root
    state: link
  when: ansible_distribution == "OmniOS"

- name: install build tools meta package (OpenIndiana)
  pkg5:
    name:
      - pkg:/metapackages/build-essential
  register: result
  until: not result|failed
  retries: 10
  delay: 60
  when: ansible_distribution == "OpenIndiana"

- name: install additional packages
  pkg5:
    name:
      - pkg:/install/distribution-constructor
      - pkg:/system/test/fio
      - pkg:/system/test/zfstest
  register: result
  until: not result|failed
  retries: 10
  delay: 60

---
- name: install build tools meta package (OmniOS)
  pkg5:
    name:
      - pkg:/developer/illumos-tools
  register: result
  until: not result|failed
  retries: 10
  delay: 60
  when: ansible_distribution == "OmniOS"

#
# Since OmniOS doesn't install the "easy_install" in any easy to find
# location (e.g. it's not in the default PATH), we add a symlink so
# later scripts and Ansible roles will be able to easily find it.
#
- name: create easy_install symlink (OmniOS)
  file:
    src: /usr/lib/python2.6/vendor-packages/easy_install
    dest: /usr/bin/easy_install
    owner: root
    group: root
    state: link
  when: ansible_distribution == "OmniOS"

- name: install build tools meta package (OpenIndiana)
  pkg5:
    name:
      - pkg:/metapackages/build-essential
  register: result
  until: not result|failed
  retries: 10
  delay: 60
  when: ansible_distribution == "OpenIndiana"

- name: install additional packages
  pkg5:
    name:
      - pkg:/archiver/gnu-tar
      - pkg:/install/distribution-constructor
      - pkg:/system/test/fio
      - pkg:/system/test/zfstest
  register: result
  until: not result|failed
  retries: 10
  delay: 60

Fix result tarballs for zfstest and zloop
Fix result tarballs for zfstest and zloop

As of the following commit:

    commit bd6e151d99528fcaaea38ca493cf62c41fb466b3
    Author: Prakash Surya <prakash.surya@delphix.com>
    Date:   Wed Feb 8 20:18:01 2017 -0800

        Refactor build script and Ansible role

the tarballs that are generated from zfstest and zloop runs have been
broken due to the OmniOS build system not having the "gtar" utility
installed. This patch fixes the issue by adding the necessary package to
the list of packages installed when configuring the build system.
