---
sudo: required
language: python
services: docker

env:
  - version=">=2.7,<2.8" distro="alpine-latest" expectation="fail"
  - version="" distro="alpine-latest" expectation="fail"
  - version="devel" distro="alpine-latest" expectation="fail"
  - version=">=2.7,<2.8" distro="alpine-edge" expectation="fail"
  - version="" distro="alpine-edge" expectation="fail"
  - version="devel" distro="alpine-edge" expectation="fail"
  - version=">=2.7,<2.8" distro="archlinux" expectation="fail"
  - version="" distro="archlinux" expectation="fail"
  - version="devel" distro="archlinux" expectation="fail"
  - version=">=2.7,<2.8" distro="centos-6" expectation="fail"
  - version="" distro="centos-6" expectation="fail"
  - version="devel" distro="centos-6" expectation="fail"
  - version=">=2.7,<2.8" distro="centos-latest"
  - version="" distro="centos-latest"
  - version="devel" distro="centos-latest"
  - version=">=2.7,<2.8" distro="debian-latest"
  - version="" distro="debian-latest"
  - version="devel" distro="debian-latest"
  - version=">=2.7,<2.8" distro="debian-stable"
  - version="" distro="debian-stable"
  - version="devel" distro="debian-stable"
  - version=">=2.7,<2.8" distro="debian-unstable"
  - version="" distro="debian-unstable"
  - version="devel" distro="debian-unstable"
  - version=">=2.7,<2.8" distro="fedora-latest"
  - version="" distro="fedora-latest"
  - version="devel" distro="fedora-latest"
  - version=">=2.7,<2.8" distro="fedora-rawhide"
  - version="" distro="fedora-rawhide"
  - version="devel" distro="fedora-rawhide"
  - version=">=2.7,<2.8" distro="opensuse-leap"
  - version="" distro="opensuse-leap"
  - version="devel" distro="opensuse-leap"
  - version=">=2.7,<2.8" distro="ubuntu-rolling"
  - version="" distro="ubuntu-rolling"
  - version="devel" distro="ubuntu-rolling"
  - version=">=2.7,<2.8" distro="ubuntu-latest"
  - version="" distro="ubuntu-latest"
  - version="devel" distro="ubuntu-latest"
  - version=">=2.7,<2.8" distro="ubuntu-devel"
  - version="" distro="ubuntu-devel"
  - version="devel" distro="ubuntu-devel"

matrix:
  allow_failures:
    - env: version=">=2.7,<2.8" distro="alpine-edge" expectation="fail"
    - env: version="" distro="alpine-edge" expectation="fail"
    - env: version="devel" distro="alpine-edge" expectation="fail"
    - env: version="devel" distro="alpine-latest" expectation="fail"
    - env: version="devel" distro="archlinux" expectation="fail"
    - env: version="devel" distro="centos-6" expectation="fail"
    - env: version="devel" distro="centos-latest"
    - env: version="devel" distro="debian-latest"
    - env: version="devel" distro="debian-stable"
    - env: version=">=2.7,<2.8" distro="debian-unstable"
    - env: version="" distro="debian-unstable"
    - env: version="devel" distro="debian-unstable"
    - env: version="devel" distro="fedora-latest"
    - env: version=">=2.7,<2.8" distro="fedora-rawhide"
    - env: version="" distro="fedora-rawhide"
    - env: version="devel" distro="fedora-rawhide"
    - env: version="devel" distro="opensuse-leap"
    - env: version="devel" distro="ubuntu-rolling"
    - env: version=">=2.7,<2.8" distro="ubuntu-devel"
    - env: version="" distro="ubuntu-devel"
    - env: version="devel" distro="ubuntu-devel"
    - env: version="devel" distro="ubuntu-latest"

cache:
  - pip

install:
  - pip install --upgrade pip
  - if [ "${version}" != "devel" ] ; then pip install ansible"${version}" ; fi
  - if [ "${version}" = "devel" ] ; then pip install git+https://github.com/ansible/ansible.git@devel ; fi
  - pip install molecule
  - pip install docker

script:
  - if [ "${expectation}" = "fail" ] ; then ! molecule test --scenario-name "${distro}" ; else molecule test --scenario-name "${distro}" ; fi

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/
  slack:
    secure: "m6jjS1/GZUUlovX2COeIGwVpS4iDfqAfX40onVjhCebOe5lMd259HTGk96QXPnh31VaonIfRfCgOjomcVKVBxZ1ELDKE/arwaflL6qc0zWHHH3cNzJjbTbouuSNGMrXA6y6Xlx6hBFb88PkpbiU07yO905RR2e5Jb8xse+zfzgFw451rfWLvbPXdskmC7YKzJ2T5heSG+eJE9EMOt4ZVj7wjWolNyGnW+QJetdZJTdokFRxgxSxPq8A0cLUBmC7nHEigycPimcDArikAU5wARs27Irp0bDjG+lDxcWj/0PEuDJjnpEc8j4pgSuMgLtmKMp+J75oC4FMcoOcYKL2FbDcY9fAbrfA/rK7kQq47QdtUjo6oP9BulP1Kl7/CRKXcM33QV5r5Yv80kDx+aOHVgf2ZqoKmtQovcS34VR94e8WwwRJloP0rz+8zoXci7tKOMeea5uvKws0zMRwjTlfRHrtOWT6yU0gL8o9dYLyyA1HhaV3kApuiBMH2FioMUteYzKCVWW3YO3PJO4CCJrltHaMPpRTCGY5bDn7Py3qqO41WTWJ6mzbZjLxNhHh/0R6xaV4BQH6qjkMH6WyS7ctaRBtGdkLW9nNmEJx2MLz3IYCAlY5Cs0BS1eKVoq6FVl0qwbhl24kiUekVTYSA6qti/VfoOyGKGGAqCBEyq/aKfSo="
  email: false
