---
# tasks file for travis
- name: test veriables and environment
  assert:
    that:
      - travis_package_state is defined
      - travis_package_state == "present" or
        travis_package_state == "latest" or
        travis_package_state == "absent"

- name: install requirements
  package:
    name: "{{ travis_requirements }}"
    state: "{{ travis_package_state }}"
  register: travis_install_requirements
  until: travis_install_requirements is succeeded
  retries: 3

- name: install travis
  gem:
    name: "{{ travis_package }}"
    state: "{{ travis_package_state }}"
    user_install: no
  register: travis_install_travis
  until: travis_install_travis is succeeded
  retries: 3
