---
language: python
python: "2.7"
before_install:
 - sudo apt-get update -qq
install:
  - pip install ansible-lint
  - pip install flake8
script:
  - ansible-lint tasks/main.yml
  - set -e ; for i in files/*.sh; do bash -n $i ;done 
  - set -e ; for i in files/*.py; do flake8 $i ;done
  - "echo '---\n- hosts: 127.0.0.1\n  remote_user: root\n  roles:' > role.yml"
  - echo "  - ${TRAVIS_REPO_SLUG/*\//}" >> role.yml
  - "echo '[defaults]\nroles_path = ../\n' > ansible.cfg"
  - ansible-playbook -i '127.0.0.1,' --syntax-check role.yml
  - ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml
  - ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml | grep -q 'changed=0.*failed=0'
  

---
language: python
python: "2.7"
before_install:
 - sudo apt-get update -qq
install:
  - pip install ansible-lint
  - pip install flake8
script:
# verify the syntax of the playbook
  - ansible-lint tasks/main.yml
# verify any shell script
  - set -e ; for i in files/*.sh; do bash -n $i ;done
# verify python script with pyflakes and pep8
  - set -e ; for i in files/*.py; do flake8 $i ;done
# setup the environment to run ansible
  - "echo '---\n- hosts: 127.0.0.1\n  remote_user: root\n  roles:' > role.yml"
  - echo "  - ${TRAVIS_REPO_SLUG/*\//}" >> role.yml
  - "echo '[defaults]\nroles_path = ../\n' > ansible.cfg"
# run a 2nd syntax check ( not sure if ansible-lint shouldn't already do that )
  - ansible-playbook -i '127.0.0.1,' --syntax-check role.yml
# check that the role can be run
  - ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml
# verify idempotence ( ie, running a 2nd time shouldn't change anything )
  - ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml | grep -q 'changed=0.*failed=0'
  

Add a few comments to detail what each line is doing
Add a few comments to detail what each line is doing
