You've already forked ansible-role-csf
67 lines
2.7 KiB
YAML
67 lines
2.7 KiB
YAML
---
|
|
dist: bionic
|
|
sudo: false
|
|
language: python
|
|
services: docker
|
|
cache: pip
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- python-pip
|
|
|
|
env:
|
|
global:
|
|
- _ANSIBLE_CONNECTION=local
|
|
- _ANSIBLE_PLAYBOOK=tests/docker_playbook.yml
|
|
matrix:
|
|
- _ANSIBLE_CONNECTION=ssh _ANSIBLE_PLAYBOOK=tests/test.yml
|
|
_DOCKER_NAME=alpine _DOCKER_IMAGE=alpine
|
|
# - _DOCKER_NAME=centos6 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:centos-6 _DOCKER_IMAGE_INIT=/sbin/init
|
|
- _DOCKER_NAME=centos7 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:centos-7 _DOCKER_IMAGE_INIT=/usr/lib/systemd/systemd
|
|
- _DOCKER_NAME=debian8 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:debian-8 _DOCKER_IMAGE_INIT=/lib/systemd/systemd
|
|
- _DOCKER_NAME=debian9 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:debian-9 _DOCKER_IMAGE_INIT=/lib/systemd/systemd
|
|
- _DOCKER_NAME=ubuntu16 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:ubuntu-16.04 _DOCKER_IMAGE_INIT=/lib/systemd/systemd
|
|
- _DOCKER_NAME=ubuntu18 _DOCKER_IMAGE=ansiblecheck/ansiblecheck:ubuntu-18.04 _DOCKER_IMAGE_INIT=/lib/systemd/systemd
|
|
|
|
matrix:
|
|
fast_finish: true
|
|
|
|
before_install:
|
|
- >
|
|
ssh-keygen -t rsa -C travis@localhost -q -P '' -f ~/.ssh/id_rsa ;
|
|
cat /home/travis/.ssh/id_rsa.pub >> /home/travis/.ssh/authorized_keys ;
|
|
printf 'Host *\n\tStrictHostKeyChecking no\n\tUserKnownHostsFile=/dev/null\n' > /home/travis/.ssh/config;
|
|
|
|
install:
|
|
# - travis_retry pip install git+git://github.com/ansible/ansible.git@devel
|
|
- travis_retry pip install --upgrade --upgrade-strategy=eager ansible ansible-lint
|
|
- travis_retry docker pull ${_DOCKER_IMAGE}
|
|
|
|
before_script:
|
|
- printf '[defaults]\nroles_path=../\nhost_key_checking = False\nretry_files_enabled = False\n\n[ssh_connection]\npipelining = True\n' > ansible.cfg
|
|
- printf 'localhost' > inventory
|
|
- sudo ln -s /bin/true /usr/sbin/sendmail
|
|
- ansible --version
|
|
|
|
script:
|
|
- ansible-lint -v ${_ANSIBLE_PLAYBOOK}
|
|
- >
|
|
ansible-playbook -i inventory ${_ANSIBLE_PLAYBOOK}
|
|
--connection=${_ANSIBLE_CONNECTION}
|
|
--extra-vars "DOCKER_NAME=${_DOCKER_NAME} DOCKER_IMAGE=${_DOCKER_IMAGE} DOCKER_IMAGE_INIT=${_DOCKER_IMAGE_INIT}"
|
|
--skip-tags "destroy"
|
|
-vv
|
|
- >
|
|
ANSIBLE_LOG_PATH=/tmp/idempotence.log
|
|
ansible-playbook -i inventory ${_ANSIBLE_PLAYBOOK}
|
|
--connection=${_ANSIBLE_CONNECTION}
|
|
--extra-vars "DOCKER_NAME=${_DOCKER_NAME} DOCKER_IMAGE=${_DOCKER_IMAGE} DOCKER_IMAGE_INIT=${_DOCKER_IMAGE_INIT}"
|
|
- >
|
|
awk '/PLAY RECAP/,/EOF/
|
|
{if (NF && $7 !~ "PLAY" && $10$11$12 !~ "changed=0unreachable=0failed=0" ) status=1 } END
|
|
{ print (status)? "Idempotence test: FAIL" : "Idempotence test: PASS"; exit status }'
|
|
/tmp/idempotence.log
|
|
|
|
notifications:
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|