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

env:
  - version=">=2.7,<2.8" distro="alpine-latest"
  - version="" distro="alpine-latest"
  - version="devel" distro="alpine-latest"
  - version=">=2.7,<2.8" distro="alpine-edge"
  - version="" distro="alpine-edge"
  - version="devel" distro="alpine-edge"
  - version=">=2.7,<2.8" distro="archlinux"
  - version="" distro="archlinux"
  - version="devel" distro="archlinux"
  - version=">=2.7,<2.8" distro="centos-6"
  - version="" distro="centos-6"
  - version="devel" distro="centos-6"
  - 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"
    - 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"
    - 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: "VFUXKZ3ZK4S858FeA1ynlaMi2HWx34weehc92wXsqsFnYL2NEdV0KObpAUknmsXTWhem862eP2Vk+vYj61Ut6wK3fS42g8z1xuZhlu9ITG0Sctp7DSH1wq1L331O0v3gzy31D5Wb/blPto0DIkdgjOyLFcM1Rt0HFLekEypv3Bwuqo8I1GXnYjRY9eY8Pkw8qFjRhm/gDjfOCeq8wIj9vBCw5TKFNC+EqU2Ugn5sKICuVclrKmvrWhyAjuJOOdhOQbBVoG1dljZdk2XE2gVzxgYsv0vA0Qc0uZCl/c2QSZKAaaxy8tQiyy44qmeLhlsBRPMRTbi1p7uJNn6ktmbgNl5CN2IhOMoYLnTc/4dZMKWYy6bZgGd7wSD+S3w02sSk1Z/RpAwpvqB7LrZMmPCjvQsytQXQvhWo6lI6CuHSEURTdSv68Po16hgwxsnKbo0mSY6GTZr/hRUh6omooYagV8UmjeDNTU02GoUZwzrCIsQfh/VGZ36xmpTpA47esuVLNZYiUOkGYYv6eB3o/OLZx85syaXF0QEdlgU8NCjiyTN0HCD6Yc+vj4JCmez5KVV9c9+mXsotWDu14MH18+GASb5a5MDYviKC2CmDCeaVL2UC0Z+mOAQ+QK+sqNFkOHdOSQ8UXPq5ti5LS1VYJxv2iQVqv1D20RRe1rOSPRFADBQ="
  email: false
