Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ansible
roles
nagios-nrpe-agent
Commits
bdac45eb
Commit
bdac45eb
authored
Aug 24, 2018
by
Dan Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[
#1
] We don't need set -ex for idempotence test
parent
6288045c
Pipeline
#2145
passed with stage
in 1 minute and 24 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
.gitlab-ci.yml
.gitlab-ci.yml
+40
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
bdac45eb
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)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment