Skip to content

Commit ecf9f53

Browse files
committed
Merge branch 'main' into feature/pgsql-schemas
2 parents 5245c50 + 9fbc7da commit ecf9f53

File tree

70 files changed

+2621
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2621
-56
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ on:
1212
paths:
1313
- roles/**
1414
- plugins/**
15-
- molecule/**
16-
- tests/**
15+
- molecule/default/**
1716
pull_request:
1817
branches:
1918
- 'feature/**'
@@ -42,7 +41,7 @@ jobs:
4241
uses: actions/checkout@v4
4342

4443
- name: Set up Python
45-
uses: actions/setup-python@v4
44+
uses: actions/setup-python@v5
4645
with:
4746
python-version: ${{ matrix.python }}
4847

.github/workflows/python-test.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
uses: actions/checkout@v4
3030

3131
- name: Set up Python
32-
uses: actions/setup-python@v4
32+
uses: actions/setup-python@v5
3333
with:
3434
python-version: ${{ matrix.python }}
3535
- name: Install dependencies
@@ -54,13 +54,19 @@ jobs:
5454
uses: actions/checkout@v4
5555

5656
- name: Set up Python
57-
uses: actions/setup-python@v4
57+
uses: actions/setup-python@v5
5858

5959
with:
6060
python-version: ${{ matrix.python }}
6161

62+
- name: Install dependencies
63+
run: |
64+
python3 -m pip install --upgrade pip
65+
python3 -m pip install "ansible-core>=2.13.10" "requests>=1.0.0"
66+
6267
- name: Test with unittest
6368
run: |
6469
python -m unittest -v tests.unittestpy3.test_data
70+
python -m unittest -v tests.unittestpy3.test_inventory
6571
env:
6672
MOLECULE_DISTRO: ${{ matrix.distro }}#
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_redis
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- 'feature/**'
13+
- 'fix/**'
14+
- '!doc/**'
15+
paths:
16+
- roles/icingadb_redis/**
17+
- molecule/role-icingadb_redis/**
18+
pull_request:
19+
branches:
20+
- 'feature/**'
21+
- 'fix/**'
22+
- '!doc/**'
23+
24+
jobs:
25+
icingadb_redis-ubuntu2204-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_redis]
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: 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-icingaweb2
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- 'feature/**'
13+
- 'fix/**'
14+
- '!doc/**'
15+
paths:
16+
- roles/icingaweb2/**
17+
- molecule/role-icingaweb2/**
18+
pull_request:
19+
branches:
20+
- 'feature/**'
21+
- 'fix/**'
22+
- '!doc/**'
23+
24+
jobs:
25+
icingaweb2-ubuntu2204-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-icingaweb2]
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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Icingaweb2 Templates
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
branches:
7+
- main
8+
- 'feature/**'
9+
- 'fix/**'
10+
- '!doc/**'
11+
paths:
12+
- 'roles/icingaweb2/templates/**'
13+
- 'molecule/ini-configuration-tests/**'
14+
pull_request:
15+
branches:
16+
- 'feature/**'
17+
- 'fix/**'
18+
- '!doc/**'
19+
20+
jobs:
21+
test_ini_template:
22+
runs-on: ubuntu-latest
23+
24+
env:
25+
COLLECTION_NAMESPACE: icinga
26+
COLLECTION_NAME: icinga
27+
28+
strategy:
29+
fail-fast: false
30+
max-parallel: 1
31+
matrix:
32+
distro: [ubuntu2204]
33+
python: ['3.9', '3.10']
34+
ansible: ['2.13.10', '2.14.7']
35+
scenario: [ini-configuration-tests]
36+
37+
steps:
38+
- name: Check out code
39+
uses: actions/checkout@v4
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v5
43+
with:
44+
python-version: ${{ matrix.python }}
45+
46+
- name: Install dependencies ansible
47+
run: |
48+
python3 -m pip install --upgrade pip
49+
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt
50+
51+
- name: Install collection
52+
run: |
53+
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE
54+
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME
55+
56+
- name: Test with molecule
57+
run: |
58+
ansible --version
59+
molecule --version
60+
molecule test -s ${{ matrix.scenario }}
61+
env:
62+
MOLECULE_DISTRO: ${{ matrix.distro }}

CHANGELOG.rst

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,27 @@ Icinga.Icinga Release Notes
55
.. contents:: Topics
66

77

8-
v0.3.1
8+
v0.3.2
99
======
1010

1111
Release Summary
1212
---------------
1313

14-
This is a bugfix release
14+
This is a bugfix release, bringing two QOL features and a fix for the installation process of some of the roles which broke with v0.3.1.
15+
16+
Minor Changes
17+
-------------
18+
19+
- Added possibility to delegate ticket creation to satellites
20+
- Adjusted the installation of the director module when using the source installation.
21+
22+
Bugfixes
23+
--------
24+
25+
- Role repos: Fix bug in variable search - thanks to @gianmarco-mameli #224
26+
27+
v0.3.1
28+
======
1529

1630
Major Changes
1731
-------------

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Collection to setup and manage components of the Icinga software stack.
1616
* [Role: icinga.icinga.icingaweb2](doc/role-icingaweb2/role-icingaweb2.md)
1717
* [Role: icinga.icinga.monitoring_plugins](doc/role-monitoring_plugins/role-monitoring_plugins.md)
1818
* [List of Available Check Commands](doc/role-monitoring_plugins/check_command_list.md)
19+
* [Inventory Plugin: icinga.icinga.icinga](doc/plugins/inventory/icinga-inventory-plugin.md)
1920

2021

2122
## Installation

TESTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
## Collection Testing Guide
2+
3+
This guide will quickstart you on our testing environment and eases the way to
4+
contribute on our project.
5+
6+
### Tests
7+
8+
Currently we do some molecule tests to check if the roles work in combination
9+
and some variables to check if anything fails.
10+
11+
Then there are unit tests for the parser which generates the Icinga 2 DSL.
12+
13+
At last we implemented a way to check if our Icingaweb roles generates valid
14+
ini files.
15+
16+
### Tools
17+
18+
Make sure the following tools are available before start testing with the collection.
19+
20+
```
21+
pip install ansible-core ansible-lint molecule pytest-testinfra
22+
```
23+
24+
To test roles locally without docker/service issues, we created a molecule test
25+
with vagrant. Then you need to install [vagrant](link/to/vagrant) and the molecule plugin.
26+
27+
`pip install molecule-plugins[vagrant]`
28+
29+
To use molecule with docker install the docker plugin.
30+
31+
`pip install molecule-plugins[docker]`
32+
33+
### Roles Testing
34+
35+
To test roles over vagrant locally, it is the easiest to run the **local-default**
36+
scenario. The local-default is very big and long running. For shorter tests use
37+
the role-<rolename> scenarios.
38+
39+
`molecule test -s local-default`
40+
41+
The following tests are inplemented based on docker. Per default a **ubuntu2204**
42+
image from geerlingguy's container is used. Thanks [@geerlingguy Dockerhublink](https://hub.docker.com/u/geerlingguy)
43+
44+
To test other distros use the command with the env **MOLECULE_DISTRO**.
45+
46+
`MOLECULE_DISTRO=opensuseleap15 molecule test -s role-icingadb_redis`
47+
48+
### Templating Tests
49+
50+
The roles are generating configuration for Icingaweb2 and Icinga2 in various files.
51+
To ensure values are written to these files in right syntax we test those too.
52+
53+
#### Python Unittest
54+
55+
For testing our Icinga 2 objects syntax we implemented python unittests and try
56+
many combinations which occur in different python versions.
57+
58+
For more information please have a look at the workflow `Python Unittest`.
59+
60+
#### Icingaweb2 INI
61+
62+
To test the INI configuration over Ansible in the Icinga Web 2 role, we implemented
63+
a molecule test to include the template from the role and test it with various values.

changelogs/changelog.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,17 @@ releases:
110110
- trivial_naming_tasks.yml
111111
- trivial_wrong_variable_name.yml
112112
release_date: '2023-11-21'
113+
0.3.2:
114+
changes:
115+
bugfixes:
116+
- 'Role repos: Fix bug in variable search - thanks to @gianmarco-mameli #224'
117+
minor_changes:
118+
- Added possibility to delegate ticket creation to satellites
119+
- Adjusted the installation of the director module when using the source installation.
120+
release_summary: Bugfix Release
121+
fragments:
122+
- bugfix_variable_search.yml
123+
- feature_add_satellite_delegation.yml
124+
- feature_adjust_director_source_installation.yml
125+
- release.yml
126+
release_date: '2023-12-07'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
major_changes:
3+
- Add an Ansible Inventory Plugin to fetch host information from Icinga 2's API for use as an Ansible Inventory

0 commit comments

Comments
 (0)