-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
74 lines (60 loc) · 2.08 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
variables:
ANSIBLE_INVENTORY: "tests/inventory"
PYTHONUNBUFFERED: "1"
ANSIBLE_FORCE_COLOR: "true"
.ansible_test_template: &ansible_test
script:
- ansible --version
# Uncomment if your role have depends
# - ansible-galaxy install -v -r requirements.yml
- ansible-playbook tests/test.yml --syntax-check
- ansible-playbook -vvv --connection=local tests/test.yml
- idempotence=$(mktemp)
- ansible-playbook -vvv --connection=local tests/test.yml | tee ${idempotence}
- >
tail ${idempotence}
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1)
# This part is used to check role run.
# Add your own tests depending on your $ROLE
# - echo "=======> Starting output tests"
# We build using (ansiblecheck)[https://hub.docker.com/r/ansiblecheck/ansiblecheck/]
# images It provide a wide variety of OS container images to test with.
# most frequent ones included here
# debian-wheezy:
# image: ansiblecheck/ansiblecheck:debian-wheezy
# <<: *ansible_test
# debian-jessie:
# image: ansiblecheck/ansiblecheck:debian-jessie
# <<: *ansible_test
# debian-stretch:
# image: ansiblecheck/ansiblecheck:debian-stretch
# <<: *ansible_test
debian-buster:
image: registry.gitlab.com/lcaflc/ansiblecheck:debian-buster
<<: *ansible_test
debian-bullseye:
image: registry.gitlab.com/lcaflc/ansiblecheck:debian-bullseye
<<: *ansible_test
debian-bookworm:
image: registry.gitlab.com/lcaflc/ansiblecheck:debian-bookworm
<<: *ansible_test
ubuntu-trusty:
image: ansiblecheck/ansiblecheck:ubuntu-trusty
<<: *ansible_test
ubuntu-xenial:
image: ansiblecheck/ansiblecheck:ubuntu-xenial
<<: *ansible_test
ubuntu-bionic:
image: registry.gitlab.com/lcaflc/ansiblecheck:ubuntu-bionic
<<: *ansible_test
ubuntu-focal:
image: registry.gitlab.com/lcaflc/ansiblecheck:ubuntu-focal
<<: *ansible_test
ubuntu-jammy:
image: registry.gitlab.com/lcaflc/ansiblecheck:ubuntu-jammy
<<: *ansible_test
ubuntu-noble:
image: registry.gitlab.com/lcaflc/ansiblecheck:ubuntu-noble
<<: *ansible_test