---
language: python
python: "2.7"
sudo: required
dist: trusty
before_install:
  - sudo apt-get update -qq

install:
  - pip install ansible
  - "echo localhost > inventory remote_user=root"

script:
  - "ansible-playbook -i inventory role.yml --connection=local --sudo"
  - >
    ansible-playbook -i inventory role.yml --connection=local --sudo
    | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - >
    ansible-playbook -i inventory role.yml --connection=local --sudo
    --tags unattended | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - apt-config dump | grep 'Unattended-Upgrade "1"'
  - sudo unattended-upgrades --dry-run -d

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

---
language: python
python: "2.7"
sudo: required
dist: trusty
before_install:
  - sudo apt-get update -qq

install:
  - pip install ansible
  - "echo localhost > inventory remote_user=root"

script:
  - "ansible-playbook -i inventory role.yml --connection=local --sudo"
  - >
    ansible-playbook -i inventory role.yml --connection=local --sudo
    | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - >
    ansible-playbook -i inventory role.yml --connection=local --sudo
    --tags unattended | grep -q 'changed=0.*failed=0'
    && (echo 'Idempotence test: pass' && exit 0)
    || (echo 'Idempotence test: fail' && exit 1)
  - apt-config dump | grep 'Unattended-Upgrade "1"'
  - sudo unattended-upgrades --dry-run

notifications:
  webhooks: https://galaxy.ansible.com/api/v1/notifications/

Reduce noise generated by dry run in Travis
Reduce noise generated by dry run in Travis