Skip to content

Commit

Permalink
Merge branch 'main' into feature/pgsql-schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
mkayontour committed Jan 17, 2024
2 parents 5245c50 + 9fbc7da commit ecf9f53
Show file tree
Hide file tree
Showing 70 changed files with 2,621 additions and 56 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ on:
paths:
- roles/**
- plugins/**
- molecule/**
- tests/**
- molecule/default/**
pull_request:
branches:
- 'feature/**'
Expand Down Expand Up @@ -42,7 +41,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand All @@ -54,13 +54,19 @@ jobs:
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5

with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "ansible-core>=2.13.10" "requests>=1.0.0"
- name: Test with unittest
run: |
python -m unittest -v tests.unittestpy3.test_data
python -m unittest -v tests.unittestpy3.test_inventory
env:
MOLECULE_DISTRO: ${{ matrix.distro }}#
66 changes: 66 additions & 0 deletions .github/workflows/role-icingadb_redis.yml
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 }}
66 changes: 66 additions & 0 deletions .github/workflows/role-icingaweb2.yml
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 }}
62 changes: 62 additions & 0 deletions .github/workflows/test_icingaweb2_ini_template.yml
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 }}
18 changes: 16 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,27 @@ Icinga.Icinga Release Notes
.. contents:: Topics


v0.3.1
v0.3.2
======

Release Summary
---------------

This is a bugfix release
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.

Minor Changes
-------------

- Added possibility to delegate ticket creation to satellites
- Adjusted the installation of the director module when using the source installation.

Bugfixes
--------

- Role repos: Fix bug in variable search - thanks to @gianmarco-mameli #224

v0.3.1
======

Major Changes
-------------
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Collection to setup and manage components of the Icinga software stack.
* [Role: icinga.icinga.icingaweb2](doc/role-icingaweb2/role-icingaweb2.md)
* [Role: icinga.icinga.monitoring_plugins](doc/role-monitoring_plugins/role-monitoring_plugins.md)
* [List of Available Check Commands](doc/role-monitoring_plugins/check_command_list.md)
* [Inventory Plugin: icinga.icinga.icinga](doc/plugins/inventory/icinga-inventory-plugin.md)


## Installation
Expand Down
63 changes: 63 additions & 0 deletions TESTING.md
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.
14 changes: 14 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,17 @@ releases:
- trivial_naming_tasks.yml
- trivial_wrong_variable_name.yml
release_date: '2023-11-21'
0.3.2:
changes:
bugfixes:
- 'Role repos: Fix bug in variable search - thanks to @gianmarco-mameli #224'
minor_changes:
- Added possibility to delegate ticket creation to satellites
- Adjusted the installation of the director module when using the source installation.
release_summary: Bugfix Release
fragments:
- bugfix_variable_search.yml
- feature_add_satellite_delegation.yml
- feature_adjust_director_source_installation.yml
- release.yml
release_date: '2023-12-07'
3 changes: 3 additions & 0 deletions changelogs/fragments/feature_ansible_inventory.yml
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
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"
2 changes: 2 additions & 0 deletions changelogs/fragments/fix-173-changeable-dependency-repos.yml
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`
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_advanced_ldap_filters.yml
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"
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_change_order_of_module_tasks.yml
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"
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_issue_228.yml
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)
3 changes: 3 additions & 0 deletions changelogs/fragments/fix_missing_quotes_delegate_ticket.yml
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."
3 changes: 3 additions & 0 deletions changelogs/fragments/minor_change_adjust_vars_lookup.yml
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.
Loading

0 comments on commit ecf9f53

Please sign in to comment.