1
0
mirror of https://github.com/dev-sec/ansible-nginx-hardening.git synced 2024-11-26 11:13:45 +01:00
ansible-nginx-hardening/.travis.yml

73 lines
2.4 KiB
YAML
Raw Normal View History

2016-07-26 12:28:52 +02:00
---
2017-01-21 21:21:06 +01:00
services: docker
2016-07-26 12:28:52 +02:00
env:
2017-01-21 21:21:06 +01:00
- distro: centos6
version: latest
init: /sbin/init
- distro: centos7
2018-08-15 18:16:50 +02:00
init: /lib/systemd/systemd
2017-01-21 21:21:06 +01:00
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
version: latest
- distro: oracle6
version: latest
init: /sbin/init
# - distro: oracle7
# init: /usr/lib/systemd/systemd
# run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
# version: latest
2017-01-21 21:21:06 +01:00
2018-10-11 09:33:01 +02:00
- distro: ubuntu1404
version: latest
init: /sbin/init
2017-01-21 21:21:06 +01:00
- distro: ubuntu1604
version: latest
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2018-10-11 09:33:01 +02:00
- distro: ubuntu1804
2017-01-21 21:21:06 +01:00
version: latest
2018-10-11 09:33:01 +02:00
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2017-01-21 21:21:06 +01:00
- distro: debian8
version: latest
init: /sbin/init
2018-08-15 18:16:50 +02:00
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2017-01-21 21:21:06 +01:00
- distro: debian9
version: latest
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2016-07-26 12:28:52 +02:00
# - distro: amazon
# init: /lib/systemd/systemd
# version: latest
# run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
2018-08-15 18:16:50 +02:00
2016-07-26 12:28:52 +02:00
before_install:
2017-01-21 21:21:06 +01:00
# Pull container
- 'docker pull rndmh3ro/docker-${distro}-ansible:${version}'
2016-07-26 12:28:52 +02:00
script:
2017-01-21 21:21:06 +01:00
- container_id=$(mktemp)
# Run container in detached state.
- 'docker run --detach --volume="${PWD}":/etc/ansible/roles/ansible-nginx-hardening:ro ${run_opts} rndmh3ro/docker-${distro}-ansible:${version} "${init}" > "${container_id}"'
# Install ansible galaxy requirements
- 'docker exec "$(cat ${container_id})" ansible-galaxy -c install -r /etc/ansible/roles/ansible-nginx-hardening/requirements.yml -p /etc/ansible/roles/'
2017-01-21 21:21:06 +01:00
# Test role.
2018-08-15 18:16:50 +02:00
- 'docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/ansible-nginx-hardening/tests/test.yml -vv'
2017-01-21 21:21:06 +01:00
# Verify role
#- 'inspec exec https://github.com/dev-sec/nginx-baseline/ -t docker://$(cat ${container_id}) --controls=nginx-01 nginx-02 nginx-03 nginx-04 nginx-05 nginx-06 nginx-07 nginx-08 nginx-09 nginx-10 nginx-12 nginx-13 nginx-14 nginx-15 nginx-17 --no-distinct-exit'
- 'inspec exec https://github.com/dev-sec/nginx-baseline/ -t docker://$(cat ${container_id}) --controls=nginx-01 nginx-02 nginx-03 nginx-05 nginx-06 nginx-07 nginx-08 nginx-09 nginx-10 nginx-12 nginx-13 nginx-15 nginx-17 --no-distinct-exit'
2017-01-21 21:21:06 +01:00
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/