Skip to content

Commit

Permalink
Merge branch 'main' into feature/icingaweb-module-graphite
Browse files Browse the repository at this point in the history
  • Loading branch information
mkayontour authored Jan 17, 2024
2 parents 034ed58 + 9fbc7da commit 4f8c8c1
Show file tree
Hide file tree
Showing 83 changed files with 2,962 additions and 71 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
- 'feature/**'
- 'fix/**'
- '!doc/**'
paths:
- roles/**
- plugins/**
- molecule/default/**
pull_request:
branches:
- 'feature/**'
Expand Down Expand Up @@ -37,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 }}
42 changes: 42 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,48 @@ Icinga.Icinga Release Notes
.. contents:: Topics


v0.3.2
======

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

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
-------------

- Added Installation of Business Process Modeling Module

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

- Adds password capabilities to icingadb-redis configuration (#202)
- support Raspbian armhf repos (#203)

Bugfixes
--------

- Fix incorrect behaviour within `monitoring_plugins` that lead to a cycle of installation and removal of the same packages within one play
- Fix incorrect templating when passing integers in some parts of the Icinga Web 2 configuration.
- Fix to use correct URL for Debian Ubuntu (#195)
- Fixed typo in api.yml file (exits to exists)
- Role Icingaweb2: Adjust preferences setting to store preferences in database

v0.3.0
======

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.
Loading

0 comments on commit 4f8c8c1

Please sign in to comment.