language: python
env:
  - ANSIBLE_VERSION="1.9.*"
  - ANSIBLE_VERSION="1.8.*"
  - ANSIBLE_VERSION="1.7.*"
  - ANSIBLE_VERSION="1.6.*"
  - ANSIBLE_VERSION="1.5.*"
  - ANSIBLE_VERSION="1.4.*"
  - ANSIBLE_VERSION="1.3.*"
  - ANSIBLE_VERSION="1.2.*"
install:
  - pip install ansible==$ANSIBLE_VERSION
script:
  # Check the role syntax
  - ansible-playbook --inventory='localhost,' tests/test.yml --syntax-check
  # Check that the role can run with no errors/failures
  - ansible-playbook --inventory='localhost,' tests/test.yml --connection=local
  # Check idempotence of the role by running it twice and making sure there are
  # no changed/failed tasks
  - >
    ansible-playbook --inventory='localhost,' tests/test.yml --connection=local
    | tee /dev/stderr
    | grep -q 'changed=0.*failed=0'
    && (printf '\n*** Idempotence test: ok ***\n' && exit 0)
    || (printf "\n*** Idempotence test: failed ***\n" && exit 1)
  - ./tests/tests.sh
sudo: required

language: python
env:
  - ANSIBLE_VERSION="1.9.*"
  - ANSIBLE_VERSION="1.8.*"
  - ANSIBLE_VERSION="1.7.*"
  - ANSIBLE_VERSION="1.6.*"
  - ANSIBLE_VERSION="1.5.*"
  - ANSIBLE_VERSION="1.4.*"
  - ANSIBLE_VERSION="1.3.*"
  - ANSIBLE_VERSION="1.2.*"
before_install:
  - sudo apt-get update -qq
install:
  - pip install ansible==$ANSIBLE_VERSION
script:
  # Check the role syntax
  - ansible-playbook --inventory='localhost,' tests/test.yml --syntax-check
  # Check that the role can run with no errors/failures
  - ansible-playbook --inventory='localhost,' tests/test.yml --connection=local
  # Check idempotence of the role by running it twice and making sure there are
  # no changed/failed tasks
  - >
    ansible-playbook --inventory='localhost,' tests/test.yml --connection=local
    | tee /dev/stderr
    | grep -q 'changed=0.*failed=0'
    && (printf '\n*** Idempotence test: ok ***\n' && exit 0)
    || (printf "\n*** Idempotence test: failed ***\n" && exit 1)
  - ./tests/tests.sh
sudo: required

Make sure apt-get is up-to-date before provisioning on Travis CI
Make sure apt-get is up-to-date before provisioning on Travis CI
