---
language: python
python: "2.7"

env:
  - SITE=playbook.yml

before_install:
  - sudo apt-get update -qq
  - sudo apt-get install curl -y

install:
  - pip install -U ansible

  # 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/$SITE --syntax-check"

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

  # Healthcheck
  # - "curl http://localhost:8080/"

---
language: python
python: "2.7"

env:
  - SITE=playbook.yml

before_install:
  - sudo apt-get update -qq
  - sudo apt-get install curl -y

install:
  - pip install -U ansible

  # Add ansible.cfg to pick up roles path.
  - "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
  
  # Install Mesosphere, marathon needs it
  - sudo sh -c "echo 'deb http://repos.mesosphere.com/$(lsb_release -is | tr '[:upper:]' '[:lower:]') $(lsb_release -cs) main' >> /etc/apt/sources.list.d/mesosphere.list"
  - sudo apt-get update -qq
  - sudo apt-get install mesos -y --force-yes
  - sudo sh -c "echo 1 > /etc/zookeeper/conf/myid"
  - sudo sh -c "echo 'server.1=localhost:2888:3888' >> /etc/zookeeper/conf/zoo.cfg"
  - sudo service zookeeper restart
  - sudo service mesos-master restart

script:
  # Check the role/playbook's syntax.
  - "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"

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


Add steps in Travis build to install mesosphere.
Add steps in Travis build to install mesosphere.
