---

# https://www.jeffgeerling.com/blog/testing-ansible-roles-travis-ci-github
# We don't need sudo here because we only create some files in /tmp

sudo: no
language: python
python: "2.7"

install:
  - pip install ansible passlib ansible-lint

script:
  - echo "[defaults]"      > ansible.cfg
  - echo "roles_path=../" >> ansible.cfg
  - ansible-lint tests/test.yml
  - ansible-playbook -i tests/inventory tests/test.yml --syntax-check
  - ansible-playbook -i tests/inventory tests/test.yml --connection=local
  - cat /tmp/ciscohash*
  - grep '^\$1\$' /tmp/ciscohash5 || exit 1
  - grep '[0-9A-F]' /tmp/ciscohash7 || exit 1
  - grep 'NuLKvvWGg.x9HEKO' /tmp/ciscohashasa || exit 1
  - grep 'NuLKvvWGg.x9HEKO' /tmp/ciscohashpix || exit 1
  - grep 'A5XOy94YKDPXCo7U' /tmp/ciscohashasa_user || exit 1
  - grep 'A5XOy94YKDPXCo7U' /tmp/ciscohashpix_user || exit 1

---

# https://www.jeffgeerling.com/blog/testing-ansible-roles-travis-ci-github
# We don't need sudo here because we only create some files in /tmp

sudo: no
language: python
python: "2.7"

env:
  global:
  matrix:
    - ANSIBLE_VERSION="2.0.0.2"
    - ANSIBLE_VERSION="2.1.4.0"
    - ANSIBLE_VERSION="2.2.3.0"
    - ANSIBLE_VERSION="2.3.0.0"

install:
  - pip install ansible==$ANSIBLE_VERSION passlib ansible-lint

script:
  - echo "[defaults]"      > ansible.cfg
  - echo "roles_path=../" >> ansible.cfg
  - ansible-lint tests/test.yml
  - ansible-playbook -i tests/inventory tests/test.yml --syntax-check
  - ansible-playbook -i tests/inventory tests/test.yml --connection=local
  - cat /tmp/ciscohash*
  - grep '^\$1\$' /tmp/ciscohash5 || exit 1
  - grep '[0-9A-F]' /tmp/ciscohash7 || exit 1
  - grep 'NuLKvvWGg.x9HEKO' /tmp/ciscohashasa || exit 1
  - grep 'NuLKvvWGg.x9HEKO' /tmp/ciscohashpix || exit 1
  - grep 'A5XOy94YKDPXCo7U' /tmp/ciscohashasa_user || exit 1
  - grep 'A5XOy94YKDPXCo7U' /tmp/ciscohashpix_user || exit 1

Test against different Ansible 2.x versions
Test against different Ansible 2.x versions
