-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/pgsql-schemas
- Loading branch information
Showing
70 changed files
with
2,621 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
# These Jobs should be always be run against the latest version of ansible on the systems | ||
# Feel free to update python and ansible versions | ||
# | ||
# In addition to keep them quick and no additional variables are used. | ||
# | ||
name: role-icingadb_redis | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
paths: | ||
- roles/icingadb_redis/** | ||
- molecule/role-icingadb_redis/** | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
|
||
jobs: | ||
icingadb_redis-ubuntu2204-latest: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
COLLECTION_NAMESPACE: icinga | ||
COLLECTION_NAME: icinga | ||
|
||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
distro: [ubuntu2204] | ||
python: ['3.10'] | ||
ansible: ['2.16.2'] | ||
scenario: [role-icingadb_redis] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies ansible | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt | ||
- name: Install collection | ||
run: | | ||
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | ||
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | ||
- name: Test with molecule | ||
run: | | ||
ansible --version | ||
molecule --version | ||
molecule test -s ${{ matrix.scenario }} | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
# These Jobs should be always be run against the latest version of ansible on the systems | ||
# Feel free to update python and ansible versions | ||
# | ||
# In addition to keep them quick and no additional variables are used. | ||
# | ||
name: role-icingaweb2 | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
paths: | ||
- roles/icingaweb2/** | ||
- molecule/role-icingaweb2/** | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
|
||
jobs: | ||
icingaweb2-ubuntu2204-latest: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
COLLECTION_NAMESPACE: icinga | ||
COLLECTION_NAME: icinga | ||
|
||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
distro: [ubuntu2204] | ||
python: ['3.10'] | ||
ansible: ['2.16.2'] | ||
scenario: [role-icingaweb2] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies ansible | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt | ||
- name: Install collection | ||
run: | | ||
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | ||
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | ||
- name: Test with molecule | ||
run: | | ||
ansible --version | ||
molecule --version | ||
molecule test -s ${{ matrix.scenario }} | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Icingaweb2 Templates | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- main | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
paths: | ||
- 'roles/icingaweb2/templates/**' | ||
- 'molecule/ini-configuration-tests/**' | ||
pull_request: | ||
branches: | ||
- 'feature/**' | ||
- 'fix/**' | ||
- '!doc/**' | ||
|
||
jobs: | ||
test_ini_template: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
COLLECTION_NAMESPACE: icinga | ||
COLLECTION_NAME: icinga | ||
|
||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 | ||
matrix: | ||
distro: [ubuntu2204] | ||
python: ['3.9', '3.10'] | ||
ansible: ['2.13.10', '2.14.7'] | ||
scenario: [ini-configuration-tests] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
|
||
- name: Install dependencies ansible | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-test-${{ matrix.ansible }}.txt | ||
- name: Install collection | ||
run: | | ||
mkdir -p ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE | ||
cp -a ../ansible-collection-$COLLECTION_NAME ~/.ansible/collections/ansible_collections/$COLLECTION_NAMESPACE/$COLLECTION_NAME | ||
- name: Test with molecule | ||
run: | | ||
ansible --version | ||
molecule --version | ||
molecule test -s ${{ matrix.scenario }} | ||
env: | ||
MOLECULE_DISTRO: ${{ matrix.distro }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
## Collection Testing Guide | ||
|
||
This guide will quickstart you on our testing environment and eases the way to | ||
contribute on our project. | ||
|
||
### Tests | ||
|
||
Currently we do some molecule tests to check if the roles work in combination | ||
and some variables to check if anything fails. | ||
|
||
Then there are unit tests for the parser which generates the Icinga 2 DSL. | ||
|
||
At last we implemented a way to check if our Icingaweb roles generates valid | ||
ini files. | ||
|
||
### Tools | ||
|
||
Make sure the following tools are available before start testing with the collection. | ||
|
||
``` | ||
pip install ansible-core ansible-lint molecule pytest-testinfra | ||
``` | ||
|
||
To test roles locally without docker/service issues, we created a molecule test | ||
with vagrant. Then you need to install [vagrant](link/to/vagrant) and the molecule plugin. | ||
|
||
`pip install molecule-plugins[vagrant]` | ||
|
||
To use molecule with docker install the docker plugin. | ||
|
||
`pip install molecule-plugins[docker]` | ||
|
||
### Roles Testing | ||
|
||
To test roles over vagrant locally, it is the easiest to run the **local-default** | ||
scenario. The local-default is very big and long running. For shorter tests use | ||
the role-<rolename> scenarios. | ||
|
||
`molecule test -s local-default` | ||
|
||
The following tests are inplemented based on docker. Per default a **ubuntu2204** | ||
image from geerlingguy's container is used. Thanks [@geerlingguy Dockerhublink](https://hub.docker.com/u/geerlingguy) | ||
|
||
To test other distros use the command with the env **MOLECULE_DISTRO**. | ||
|
||
`MOLECULE_DISTRO=opensuseleap15 molecule test -s role-icingadb_redis` | ||
|
||
### Templating Tests | ||
|
||
The roles are generating configuration for Icingaweb2 and Icinga2 in various files. | ||
To ensure values are written to these files in right syntax we test those too. | ||
|
||
#### Python Unittest | ||
|
||
For testing our Icinga 2 objects syntax we implemented python unittests and try | ||
many combinations which occur in different python versions. | ||
|
||
For more information please have a look at the workflow `Python Unittest`. | ||
|
||
#### Icingaweb2 INI | ||
|
||
To test the INI configuration over Ansible in the Icinga Web 2 role, we implemented | ||
a molecule test to include the template from the role and test it with various values. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
major_changes: | ||
- Add an Ansible Inventory Plugin to fetch host information from Icinga 2's API for use as an Ansible Inventory |
4 changes: 4 additions & 0 deletions
4
changelogs/fragments/feature_enhance_icingadb_retention_configs.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
minor_changes: | ||
- "Enhance IcingaDB retention configs #200" | ||
- "Added tests for retention configs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- Add variable `icinga_monitoring_plugins_dependency_repos` to allow for later modification by the user if specific other repositories need to be activated instead of `powertools` / `crb` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
bugfixes: | ||
- "Fix quoting for ! in templating Issue #208" | ||
- "Replaced quote filter from ini template" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- "Icingaweb2: Change order of module state and configuration tasks #225" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- Fixed collect of icinga2_objects when icinga2_config_host is not defined (#228) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- "icinga2 feature api: fixed missing quotes in delegate ticket command for satellites or second master nodes." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- Adjusted the way variables get looked up from `vars['varname']` to `varname` in most places. |
Oops, something went wrong.