-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (37 loc) · 1.57 KB
/
ansible_test.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
---
name: Ansible-Test
on: [ push, pull_request ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code from Github
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.10.14
- name: Install latest Ansible through pip
run: pip install ansible
- name: Output python and ansible versions
run: |
python --version
ansible --version
- name: Create ansible.cfg with correct roles_path
run: printf '[defaults]\nroles_path=../' > ansible.cfg
- name: Basic Ansible role syntax check
run: ansible-playbook -i tests/inventory --syntax-check tests/test.yml
- name: Real Ansible run
run: ansible-playbook -i tests/inventory tests/test.yml
- name: Second run to check for indempotence (allowing 3 changes for facts gathering and DB deletion test)
run: "ansible-playbook -i tests/inventory tests/test.yml | grep -q 'changed=3.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)"
- name: DEBUG Output clickhouse-server config.xml
run: sudo cat /etc/clickhouse-server/config.xml
- name: DEBUG Output clickhouse-server user.xml
run: sudo cat /etc/clickhouse-server/users.xml
- name: DEBUG Output all open network ports on CI runner
run: sudo netstat -tulpn
- name: Setup serverspec (install gem)
run: sudo gem install serverspec
- name: Run serverspec
run: sudo rake spec