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

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

matrix:
  allow_failures:
    - env: version=">=2.6,<2.7" distro="alpine-edge"
    - env: version="" distro="alpine-edge"
    - env: version="devel" distro="alpine-edge"
    - env: version="devel" distro="alpine-latest"
    - env: version="devel" distro="archlinux"
    - 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.6,<2.7" distro="debian-unstable"
    - env: version="" distro="debian-unstable"
    - env: version="devel" distro="debian-unstable"
    - env: version="devel" distro="fedora-latest"
    - env: version=">=2.6,<2.7" distro="fedora-rawhide"
    - env: version="" distro="fedora-rawhide"
    - env: version="devel" distro="fedora-rawhide"
    - env: version="devel" distro="opensuse-leap"
    - env: version="devel" distro="opensuse-tumbleweed" expectation="fail"
    - env: version="devel" distro="ubuntu-artful"
    - env: version=">=2.6,<2.7" 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: "XuEvq7ObMmn925/engOCqVFA0Wca8DeeOft0rWEq4QG2V5NvAUswrD+4AzEkqGn8OubnyMQcktewIHsTb09ZZTZhB2pZrR9jJLe4/P2nzlSur2aVAGAFOoP55YXXv5/PPsuyGmhclEukz4tPEe9jTnNr55ioYfTgr0hvDDSFpFh0REFD+kgKwAYeCis2fthc91PHbFQ9/qstG6u6eNFeDU3omurYvETgzyryCLzn5xtfUOtj1nSfmm7EWQoG/xtj6pR9o0IVzdFRJfH7UaIFAMCry3BOnJTnPTJ0nq/2jdOpf8n04GqLf4TgBgNkCiX4S3f67MG2+5o4MRGDPA6Yi8hUZwZPp7ovS2mpoY0OHgEPfU7ASJm7e13g9Y/cVgoNuEL4MxNJyaAFPIl5FCeQtRPukTKH6ModmEARI7xnFwyFY4LWNDIZYgb/RM7l+5vkmShESz+isDm5xQ+aETDoSPaYqT+Xp4/owC61Ipyflg9dIdcdrCey/9brdOP3utjlX3xxtzbp7TP+XhDWeCysx5X7uRz1dDaSdxwYkKAfWUWOL8PBUjKuGP3AA3XiQbSK+trg0mvOdpvnGLXR79h0m4cg944t/wFOWWocER9DmXwMapWSDVK5UbatvglKPFxfUuB1KzYZU97iiXv0w0wtkYjMWAZmvdcIJVKct6i53mw="
  email: false
