-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
27 lines (24 loc) · 1.55 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
image: ubuntu:16.04
before_script:
- apt update && apt install python-pip libssl-dev git -y
- pip install ansible
test_inventory:
script:
- ansible-galaxy install -p tests/ -r tests/requirements.yml
- ansible-playbook tests/test.yml -i tests/inventory --extra-vars "remote_host=vpn-hosts" --syntax-check
- ansible-playbook tests/test.yml -i tests/inventory --extra-vars "remote_host=vpn-hosts" --connection=local
- >
ansible-playbook tests/test.yml -i tests/inventory --extra-vars "remote_host=vpn-hosts" --connection=local
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
test_vars:
script:
- ansible-galaxy install -p tests/ -r tests/requirements.yml
- ansible-playbook tests/test.yml -i tests/inventory --extra-vars '{"remote_host":"localhost","easy_rsa_inventory":False,"server_list":["s1","s2"],"client_list":["c1","c2"]}' --syntax-check
- ansible-playbook tests/test.yml -i tests/inventory --extra-vars '{"remote_host":"localhost","easy_rsa_inventory":False,"server_list":["s1","s2"],"client_list":["c1","c2"]}' --connection=local
- >
ansible-playbook tests/test.yml -i tests/inventory --extra-vars '{"remote_host":"localhost","easy_rsa_inventory":False,"server_list":["s1","s2"],"client_list":["c1","c2"]}' --connection=local
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)