machine:
  environment:
    ANSIBLE_FORCE_COLOR: 1
    PYTHONUNBUFFERED: 1
  pre:
    # use aptitude to remove dependencies
    - sudo aptitude purge -y ~npostgres
    - sudo aptitude purge -y ~nrabbitmq
    - sudo aptitude purge -y ~nmongo
    - sudo apt-get -y autoremove
    - sudo dpkg --configure -a
    - sudo apt-get -y update

dependencies:
  pre:
    - sudo apt-get install python-pip python-dev
    - sudo pip install --upgrade setuptools
    - sudo pip install ansible
    - ansible --version

test:
  pre:
    - echo localhost > inventory
    - ansible-playbook -i inventory --connection=local playbooks/requirements.yml
  override:
    - ansible-playbook -i inventory --syntax-check playbooks/stackstorm.yml
    - ansible-playbook -i inventory -vv --connection=local playbooks/stackstorm.yml
    # Now: make sure playbook can be re-ran, later: playbook idempotence test
    - ansible-playbook -i inventory -vv --connection=local playbooks/stackstorm.yml
  post:
    - st2 --version

machine:
  environment:
    ANSIBLE_FORCE_COLOR: 1
    PYTHONUNBUFFERED: 1
  pre:
    # use aptitude to remove dependencies
    - sudo aptitude purge -y ~npostgres
    - sudo aptitude purge -y ~nrabbitmq
    - sudo aptitude purge -y ~nmongo
    - sudo apt-get -y autoremove
    - sudo dpkg --configure -a
    - sudo apt-get -y update

dependencies:
  pre:
    - sudo apt-get install python-pip python-dev
    - sudo pip install --upgrade setuptools
    - sudo pip install ansible
    # fix for Python SNI (Server Name Indication) verification
    # https://github.com/ansible/ansible/issues/12161#issuecomment-136949743
    - sudo pip install urllib3 pyopenssl ndg-httpsclient pyasn1
    - ansible --version

test:
  pre:
    - echo localhost > inventory
    - ansible-playbook -i inventory --connection=local playbooks/requirements.yml
  override:
    - ansible-playbook -i inventory --syntax-check playbooks/stackstorm.yml
    - ansible-playbook -i inventory -vv --connection=local playbooks/stackstorm.yml
    # Now: make sure playbook can be re-ran, later: playbook idempotence test
    - ansible-playbook -i inventory -vv --connection=local playbooks/stackstorm.yml
  post:
    - st2 --version

Fix for Circle Python SNI error
Fix for Circle Python SNI error
