---
language: "python"
python: "2.7"

env:
  - SITE_AND_INVENTORY="tests/test.yml -i tests/inventory"

before_install:
  - "__rvm_unload ; rm -rf ~/.rvm"

install:
  - "pip install ansible==1.6.2"
  - "printf '[defaults]\nroles_path = ../' > ansible.cfg"

script:
  - >
    ruby -v
    | grep -q 'ruby'
    && (echo 'No ruby test: pass' && exit 1)
    || (echo 'No ruby test: fail' && exit 0)
  - "ansible-playbook $SITE_AND_INVENTORY --syntax-check"
  - "ansible-playbook $SITE_AND_INVENTORY --connection=local -vvvv"
  - >
    ansible-playbook $SITE_AND_INVENTORY --connection=local
    | grep -q 'changed=2.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - >
    ruby -v
    | grep -q 'ruby'
    && (echo 'Yes ruby test: pass' && exit 0)
    || (echo 'Yes ruby test: fail' && exit 1)
---
language: "python"
python: "2.7"

env:
  - SITE_AND_INVENTORY="tests/test.yml -i tests/inventory"

before_install:
  - "__rvm_unload ; rm -rf ~/.rvm"

install:
  - "pip install ansible==1.6.2"
  - "printf '[defaults]\nroles_path = ../' > ansible.cfg"

script:
  - >
    ruby -v
    | grep -q 'ruby'
    && (echo 'No ruby test: pass' && exit 1)
    || (echo 'No ruby test: fail' && exit 0)
  - "ansible-playbook $SITE_AND_INVENTORY --syntax-check"
  - "ansible-playbook $SITE_AND_INVENTORY --connection=local -vvvv"
  - >
    ansible-playbook $SITE_AND_INVENTORY --connection=local
    | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - >
    ruby -v
    | grep -q 'ruby'
    && (echo 'Yes ruby test: pass' && exit 0)
    || (echo 'Yes ruby test: fail' && exit 1)
Fix idempotence test to expect 0 changes
Fix idempotence test to expect 0 changes
