Skip to content

Commit 6745458

Browse files
authored
Merge pull request #160 from stackhpc/zuul
Initial Zuul config
2 parents bc58b35 + 86b2a41 commit 6745458

File tree

10 files changed

+137
-0
lines changed

10 files changed

+137
-0
lines changed

.ansible-lint

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ exclude_paths:
55
- changelogs/
66
- .github/
77

8+
mock_roles:
9+
- ensure-docker
10+
- ensure-pip
11+
- ensure-podman
12+
- ensure-output-dirs
13+
814
skip_list:
915
- var-naming[no-role-prefix]
1016

lint-requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ansible
2+
ansible-lint<26
3+
antsibull-changelog

tests/playbooks/post.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Prepare logs
3+
hosts: all
4+
vars:
5+
zuul_output_dir: "{{ ansible_user_dir }}/zuul-output"
6+
tasks:
7+
- name: Print all facts
8+
copy:
9+
content: "{{ hostvars[inventory_hostname] | to_nice_json }}"
10+
dest: "{{ zuul_output_dir }}/facts.json"
11+
mode: "0600"

tests/playbooks/pre.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
- name: Prepare environment
3+
hosts: all
4+
any_errors_fatal: true
5+
vars:
6+
logs_dir: "/tmp/logs"
7+
roles:
8+
- ensure-output-dirs
9+
- ensure-pip
10+
- role: "ensure-docker"
11+
when: cephadm_container_engine == "docker"
12+
- role: "ensure-podman"
13+
when: cephadm_container_engine == "podman"

tests/playbooks/run.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
- name: Install catatonit package for Podman
3+
hosts: all
4+
any_errors_fatal: true
5+
tasks:
6+
- name: Install catatonit package for Podman
7+
package:
8+
name: catatonit
9+
state: present
10+
become: true
11+
12+
- name: Run tests
13+
hosts: all
14+
any_errors_fatal: true
15+
roles:
16+
- role: cephadm
17+
vars:
18+
cephadm_public_interface: "{{ ansible_default_ipv4.interface }}"

tox.ini

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[tox]
2+
minversion = 3.18
3+
envlist = py3,linters
4+
ignore_basepython_conflict = True
5+
skipsdist = True
6+
7+
[testenv]
8+
basepython = python3
9+
usedevelop = True
10+
allowlist_externals = bash
11+
find
12+
rm
13+
deps = -r{toxinidir}/test-requirements.txt
14+
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY, \
15+
OS_STDOUT_CAPTURE,OS_STDERR_CAPTURE,OS_LOG_CAPTURE,OS_TEST_TIMEOUT, \
16+
PYTHON,OS_TEST_PATH,LISTOPT,IDOPTION
17+
18+
[testenv:linters]
19+
deps =
20+
-r{toxinidir}/lint-requirements.txt
21+
allowlist_externals = bash
22+
find
23+
commands =
24+
{[testenv:ansible-lint]commands}
25+
26+
[testenv:ansible-lint]
27+
setenv = {[testenv:linters]setenv}
28+
deps = {[testenv:linters]deps}
29+
commands =
30+
ansible-lint -p --exclude zuul.d
31+
antsibull-changelog lint

zuul.d/base.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
- job:
3+
parent: base
4+
name: cephadm-base
5+
pre-run: tests/playbooks/pre.yml
6+
run: tests/playbooks/run.yml
7+
post-run: tests/playbooks/post.yml
8+
timeout: 7200
9+
post-timeout: 1800

zuul.d/jobs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- job:
3+
name: cephadm-jammy-singlenode-docker-reef
4+
parent: cephadm-base
5+
nodeset: cephadm-jammy-single
6+
vars:
7+
cephadm_ceph_release: reef
8+
cephadm_container_engine: docker
9+
10+
- job:
11+
name: cephadm-jammy-singlenode-podman-reef
12+
parent: cephadm-base
13+
nodeset: cephadm-jammy-single
14+
vars:
15+
cephadm_ceph_release: reef
16+
cephadm_container_engine: podman

zuul.d/nodesets.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
- nodeset:
3+
name: cephadm-jammy-single
4+
nodes:
5+
- name: primary
6+
label: ubuntu-jammy
7+
groups:
8+
- name: ceph
9+
nodes:
10+
- primary
11+
- name: mons
12+
nodes:
13+
- primary
14+
- name: mgrs
15+
nodes:
16+
- primary
17+
- name: osds
18+
nodes:
19+
- primary

zuul.d/project.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- project:
3+
check:
4+
jobs:
5+
- cephadm-jammy-singlenode-docker-reef
6+
- cephadm-jammy-singlenode-podman-reef
7+
- tox-linters
8+
gate:
9+
jobs:
10+
- cephadm-jammy-singlenode-docker-reef
11+
- cephadm-jammy-singlenode-podman-reef

0 commit comments

Comments
 (0)