Skip to content

Commit 0426b95

Browse files
committed
add tests for empty role-icingadb
1 parent 16beee3 commit 0426b95

File tree

8 files changed

+126
-0
lines changed

8 files changed

+126
-0
lines changed

.github/workflows/role-icingadb.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
# These Jobs should be always be run against the latest version of ansible on the systems
3+
# Feel free to update python and ansible versions
4+
#
5+
# In addition to keep them quick and no additional variables are used.
6+
#
7+
name: role-icingadb
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- 'feature/**'
13+
- 'fix/**'
14+
- '!doc/**'
15+
paths:
16+
- roles/icingadb/**
17+
- molecule/role-icingadb/**
18+
pull_request:
19+
branches:
20+
- 'feature/**'
21+
- 'fix/**'
22+
- '!doc/**'
23+
24+
jobs:
25+
icingadb_latest:
26+
runs-on: ubuntu-latest
27+
28+
env:
29+
COLLECTION_NAMESPACE: icinga
30+
COLLECTION_NAME: icinga
31+
32+
strategy:
33+
fail-fast: false
34+
max-parallel: 1
35+
matrix:
36+
distro: [ubuntu2204]
37+
python: ['3.10']
38+
ansible: ['2.16.2']
39+
scenario: [role-icingadb]
40+
41+
steps:
42+
- name: Check out code
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: ${{ matrix.python }}
49+
50+
- name: Install dependencies ansible
51+
run: |
52+
python3 -m pip install --upgrade pip
53+
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt
54+
55+
- name: Install collection
56+
run: |
57+
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
58+
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
59+
60+
- name: Test with molecule
61+
run: |
62+
ansible --version
63+
molecule --version
64+
molecule test -s ${{ matrix.scenario }}
65+
env:
66+
MOLECULE_DISTRO: ${{ matrix.distro }}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
collections:
2+
- name: community.mysql
3+
- name: community.docker
4+
- name: community.general
5+
version: ">=2,<3"

molecule/role-icingadb/converge.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
3+
- name: Converge
4+
hosts: all
5+
collections:
6+
- icinga.icinga
7+
pre_tasks:
8+
- ansible.builtin.include_role:
9+
name: repos
10+
post_tasks:
11+
- ansible.builtin.include_role:
12+
name: icingadb

molecule/role-icingadb/dependency.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependency:
2+
name: galaxy
3+
options:
4+
role-file: requirements.yml

molecule/role-icingadb/host_vars/icinga-default.yaml

Whitespace-only changes.

molecule/role-icingadb/molecule.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
dependency:
3+
name: galaxy
4+
driver:
5+
name: docker
6+
platforms:
7+
- name: icinga-default
8+
image: "geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible:latest"
9+
command: ${MOLECULE_DOCKER_COMMAND:-""}
10+
volumes:
11+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
12+
cgroupns_mode: host
13+
privileged: true
14+
pre_build_image: true
15+
provisioner:
16+
name: ansible
17+
inventory:
18+
link:
19+
host_vars: host_vars/
20+
verifier:
21+
name: testinfra
22+
directory: tests/integration/
23+
lint: |
24+
set -e
25+
yamllint --no-warnings roles/
26+
ansible-lint roles/

molecule/role-icingadb/prepare.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: Prepare
3+
hosts: all
4+
tasks:
5+
- name: Install requirements for Debian
6+
apt:
7+
name:
8+
- gpg
9+
- apt-transport-https
10+
update_cache: yes
11+
when: ansible_os_family == "Debian"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
roles:
2+
- geerlingguy.mysql

0 commit comments

Comments
 (0)