mirror of
https://github.com/mrlesmithjr/ansible-manage-lvm.git
synced 2026-09-07 16:08:20 +03:00
Only doing a Molecule lint at this time
This commit is contained in:
+7
-44
@@ -1,52 +1,15 @@
|
||||
---
|
||||
language: python
|
||||
python: "2.7"
|
||||
|
||||
# Use the new container infrastructure
|
||||
sudo: required
|
||||
|
||||
language: python
|
||||
services:
|
||||
- docker
|
||||
|
||||
env:
|
||||
- distribution: centos
|
||||
init: /usr/lib/systemd/systemd
|
||||
version: 7
|
||||
- distribution: fedora
|
||||
init: /usr/lib/systemd/systemd
|
||||
version: 26
|
||||
- distribution: fedora
|
||||
init: /usr/lib/systemd/systemd
|
||||
version: 25
|
||||
- distribution: ubuntu
|
||||
init: /lib/systemd/systemd
|
||||
version: bionic
|
||||
- distribution: ubuntu
|
||||
init: /lib/systemd/systemd
|
||||
version: xenial
|
||||
- distribution: debian
|
||||
init: /lib/systemd/systemd
|
||||
version: stretch
|
||||
|
||||
before_install:
|
||||
- 'sudo pip install yamllint'
|
||||
- yamllint -c .yamllint.yml .
|
||||
- 'sudo docker pull ${distribution}:${version}'
|
||||
- 'sudo docker build --no-cache --rm --file=tests/Dockerfile.${distribution}-${version} --tag=${distribution}-${version}:ansible tests'
|
||||
|
||||
- sudo apt-get -qq update
|
||||
install:
|
||||
- pip3 install -r requirements.txt
|
||||
- ansible --version
|
||||
- molecule --version
|
||||
script:
|
||||
- container_id=$(mktemp)
|
||||
- role_name="ansible-manage-lvm"
|
||||
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/${role_name}:ro ${distribution}-${version}:ansible ${init} > "${container_id}"'
|
||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-lint -c /.ansible-lint /etc/ansible/roles/${role_name}/tests/test.yml'
|
||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml --syntax-check'
|
||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml'
|
||||
- >
|
||||
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/${role_name}/tests/test.yml
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
- 'sudo docker rm -f "$(cat ${container_id})"'
|
||||
|
||||
- molecule lint
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
|
||||
Reference in New Issue
Block a user