language: python
env:
  - ANSIBLE_VERSION="1.2.*"
  - ANSIBLE_VERSION="1.3.*"
  - ANSIBLE_VERSION="1.4.*"
  - ANSIBLE_VERSION="1.5.*"
  - ANSIBLE_VERSION="1.6.*"
  - ANSIBLE_VERSION="1.7.*"
  - ANSIBLE_VERSION="1.8.*"
  - ANSIBLE_VERSION="1.9.*"
install:
  - pip install ansible==$ANSIBLE_VERSION
  - sudo apt-get install supervisor
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)
sudo: required

language: python
env:
  - ANSIBLE_VERSION="1.2.*" SYMLINK="true"
  - ANSIBLE_VERSION="1.3.*" SYMLINK="true"
  - ANSIBLE_VERSION="1.4.*"
  - ANSIBLE_VERSION="1.5.*"
  - ANSIBLE_VERSION="1.6.*"
  - ANSIBLE_VERSION="1.7.*"
  - ANSIBLE_VERSION="1.8.*"
  - ANSIBLE_VERSION="1.9.*"
install:
  - if test "$SYMLINK" == "true" ; then ln -s . ansible-role-shout ; fi
  - pip install ansible==$ANSIBLE_VERSION
  - sudo apt-get install supervisor
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)
sudo: required

Install a symbolic link on Ansible 1.2/1.3 tests as role paths cannot be relative on these versions
Install a symbolic link on Ansible 1.2/1.3 tests as role paths cannot be relative on these versions
