language: python
python: "2.7"

env:
  - ANSIBLE_VERSION=1.9.1

branches:
  only:
    - master

before_install:
  - sudo apt-get update -qq

install:
  # Install Ansible.
  - if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
  # Add ansible.cfg to pick up roles path.
  - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"

script:
  # Check the role/playbook's syntax.
  - ansible-playbook -i tests/inventory tests/test.yml --syntax-check

  # Run the role/playbook with ansible-playbook.
  - ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo

  # Run the role/playbook again, checking to make sure it's idempotent.
  - >
    ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
    | grep -q 'changed=0.*failed=0' 
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)

language: python
python: "2.7"

env:
  - ANSIBLE_VERSION=latest

branches:
  only:
    - master

before_install:
  - sudo apt-get update -qq

install:
  # Install Ansible.
  - if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi
  # Add ansible.cfg to pick up roles path.
  - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"

script:
  # Check the role/playbook's syntax.
  - ansible-playbook -i tests/inventory tests/test.yml --syntax-check

  # Run the role/playbook with ansible-playbook.
  - ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo

  # Run the role/playbook again, checking to make sure it's idempotent.
  - >
    ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
    | grep -q 'changed=0.*failed=0' 
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)

Update Ansible to latest version
Update Ansible to latest version

- Fix patch path
