Commit bdac45eb authored by Dan Thomson's avatar Dan Thomson

[#1] We don't need set -ex for idempotence test

parent 6288045c
Pipeline #2145 passed with stage
in 1 minute and 24 seconds
image: alpine:3.7
cache:
key: ${CI_COMMIT_REF_SLUG}
stages:
- test
variables:
MIRROR_VALUES_FILE: mirror-values.yml
centos7_test_install:
stage: test
image: centos:centos7
before_script:
- |
yum -y update && yum -y install ansible
echo "localhost" > tests/inventory
mkdir -p tests/roles
ln -s $(pwd) tests/roles/nagios-nrpe-agent
after_script:
- rm -rf tests/roles
- rm -f $MIRROR_VALUES_FILE
script:
- |
echo -e "mirror_hostname: ${mirrorHostname}\nmirror_path: ${mirrorPath}\nmirror_protocol: ${mirrorProtocol}\n" > $MIRROR_VALUES_FILE
set -ex
# Basic role syntax check
ansible-playbook --list-hosts tests/test-playbook.yml --inventory tests/inventory --connection local
ansible-playbook tests/test-playbook.yml --inventory tests/inventory --syntax-check
# Run the first time
ansible-playbook tests/test-playbook.yml --inventory tests/inventory --connection local --extra-vars @${MIRROR_VALUES_FILE}
- >
ansible-playbook tests/test-playbook.yml --inventory tests/inventory --connection local --extra-vars @${MIRROR_VALUES_FILE}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment