Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
release
Browse files Browse the repository at this point in the history
- fix mariadb config
- fix change configuration parameters
- update README
- remove redhat based from test matrix
  • Loading branch information
bodsch committed Jul 2, 2022
1 parent 06d375b commit d60d916
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 100 deletions.
101 changes: 50 additions & 51 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,63 +133,62 @@ jobs:
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}

rpm:
name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
needs:
- lint
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
image:
- oraclelinux:8
- rockylinux:8
- almalinux:8
python-version:
- '3.9'
ansible-version:
- '4.1.0'
- '5.1.0'

steps:
- name: check out the codebase.
uses: actions/checkout@v2
with:
path: 'ansible-icingadb'

- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
# See: https://github.com/geerlingguy/ansible-role-mysql/issues/422
- name: Disable AppArmor
run: |
set -x
sudo apt-get install apparmor-profiles
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
- name: test with tox
run: |
tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- \
molecule test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
DISTRIBUTION: ${{ matrix.image }}
# rpm:
# name: "${{ matrix.image }} / python: ${{ matrix.python-version }}, ansible: ${{ matrix.ansible-version }}"
# needs:
# - lint
# runs-on: ubuntu-18.04
# strategy:
# fail-fast: false
# matrix:
# image:
# - oraclelinux:8
# - rockylinux:8
# - almalinux:8
# python-version:
# - '3.9'
# ansible-version:
# - '4.1.0'
# - '5.1.0'
#
# steps:
# - name: check out the codebase.
# uses: actions/checkout@v2
# with:
# path: 'ansible-icingadb'
#
# - name: set up python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r test-requirements.txt
#
# # See: https://github.com/geerlingguy/ansible-role-mysql/issues/422
# - name: Disable AppArmor
# run: |
# set -x
# sudo apt-get install apparmor-profiles
# sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
# sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld
#
# - name: test with tox
# run: |
# tox -e py$(printf "${{ matrix.python-version }}" | tr -d '.')-ansible$(printf "${{ matrix.ansible-version }}" | tr -d '.') -- \
# molecule test
# env:
# PY_COLORS: '1'
# ANSIBLE_FORCE_COLOR: '1'
# DISTRIBUTION: ${{ matrix.image }}

publish:
if: github.ref == 'refs/heads/main'
needs:
- arch
- deb
- rpm
runs-on: ubuntu-18.04
steps:
- name: galaxy
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ This role will fully configure and install [icingadb](https://icinga.com/docs/ic
* Debian based
- Debian 10 / 11
- Ubuntu 20.04
* RedHat based
- Alma Linux 8
- Rocky Linux 8
- OracleLinux 8

## usage

Expand Down Expand Up @@ -55,8 +51,9 @@ icingadb_database:

```yaml
icingadb_defaults_redis:
address: 127.0.0.1:6379
icingadb_redis:
host: 127.0.0.1
port: 6379
```

### `icingadb_logging`
Expand Down Expand Up @@ -117,6 +114,8 @@ history tables used to display history information in the web interface and SLA
minimal information required for SLA reporting, allowing to keep this information for longer with a smaller
storage footprint.

All parameters are given in days, e.g. `120`

#### `history-days`

**Optional**
Expand All @@ -130,15 +129,15 @@ Use options in order to enable retention only for specific categories or to over

**Optional**

Number of days to retain historical data for SLA reporting.
*Number of days* to retain historical data for SLA reporting.

#### `options`

**Optional**

Map of history category to number of days to retain its data.
Map of history category to *number of days* to retain its data.

Available categories are acknowledgement, comment, downtime, flapping, notification, sla and state.
Available categories are `acknowledgement`, `comment`, `downtime`, `flapping`, `notification` and `state`.


```yaml
Expand Down
4 changes: 4 additions & 0 deletions molecule/default/group_vars/all/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,9 @@ mariadb_config_mysqld:
performance_schema: 1
expire_logs_days: 2
max_connections: 20
# fixes
# 'You do not have the SUPER privilege and binary logging is enabled
# (you *might* want to use the less safe log_bin_trust_function_creators variable)'
log_bin_trust_function_creators: "1"

...
35 changes: 18 additions & 17 deletions molecule/default/group_vars/all/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@ icingadb_database:
password: icingadb

icingadb_redis:
address: "127.0.0.1:{{ redis_network_port }}"
host: 127.0.0.1
port: "{{ redis_network_port }}"

icingadb_logging:
level: debug
interval: "20s"
options:
database: debug
redis: debug
heartbeat: fatal
high-availability: fatal
config-sync: fatal
history-sync: fatal
runtime-updates: fatal
overdue-sync: fatal
dump-signals: fatal
interval: "3s"
# options:
# database: debug
# redis: debug
# heartbeat: debug
# high-availability: debug
# config-sync: debug
# history-sync: debug
# runtime-updates: debug
# overdue-sync: debug
# dump-signals: debug

icingadb_retention:
history_days: "90d"
sla_days: "90d"
history_days: 90
sla_days: 90
options:
acknowledgement: "10d"
comment: "10d"
downtime: "5d"
acknowledgement: 10
comment: 10
downtime: 5

...
10 changes: 5 additions & 5 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
- name: snapd
src: https://github.com/bodsch/ansible-snapd.git
scm: git
version: 1.1.0
version: 1.1.2

- name: apparmor
src: https://github.com/bodsch/ansible-apparmor.git
scm: git
version: 1.0.0
version: 1.0.1

- name: monitoring-tools
src: https://github.com/bodsch/ansible-monitoring-plugins.git
version: 1.3.5
version: 1.3.7

- name: mariadb
src: https://github.com/bodsch/ansible-mariadb.git
scm: git
# version: 2.2.8
version: 2.2.11

- name: redis
src: https://github.com/bodsch/ansible-redis.git
scm: git
version: 1.1.0
version: 1.1.1

...
8 changes: 4 additions & 4 deletions tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@
key: https://packages.icinga.com/icinga.key
state: present

- name: install icinga testing repository
- name: install icinga release repository
yum_repository:
name: icinga-testing-build
name: icinga-stable-release
state: present
description: ICINGA (testing builds for epel)
baseurl: https://packages.icinga.com/epel/$releasever/testing/
description: ICINGA
baseurl: https://packages.icinga.com/epel/$releasever/release/
gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA
gpgcheck: 1
enabled: 1
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/apt/icingadb.list.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ ansible_managed | comment }}

deb https://packages.icinga.com/{{ ansible_distribution | lower }} icinga-{{ ansible_distribution_release | lower }}-testing main
deb https://packages.icinga.com/{{ ansible_distribution | lower }} icinga-{{ ansible_distribution_release | lower }} main
{% if ansible_distribution_major_version | int == 9 %}
# debian 9 needs backports
deb http://deb.debian.org/debian stretch-backports main
Expand Down
21 changes: 11 additions & 10 deletions templates/etc/icingadb/config.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ database:
password: {{ icingadb_database.password }}

redis:
address: {{ icingadb_redis.address }}
host: {{ icingadb_redis.host }}
port: {{ icingadb_redis.port | default('6379') }}

logging:
{% if icingadb_logging.level in _valid_loglevel %}
Expand Down Expand Up @@ -76,38 +77,38 @@ logging:

retention:
{% if icingadb_retention.history_days is defined and
icingadb_retention.history_days | default('') | length > 0 %}
icingadb_retention.history_days | default('0') | int > 0 %}
history-days: {{ icingadb_retention.history_days }}
{% endif %}
{% if icingadb_retention.sla_days is defined and
icingadb_retention.sla_days | default('') | length > 0 %}
icingadb_retention.sla_days | default('0') | int > 0 %}
sla-days: {{ icingadb_retention.sla_days }}
{% endif %}
{% if icingadb_retention.options is defined and
icingadb_retention.options | default('') | length > 0 %}
icingadb_retention.options | count > 0 %}
options:
{% if icingadb_retention.options.acknowledgement is defined and
icingadb_retention.options.acknowledgement | default('') | length > 0 %}
icingadb_retention.options.acknowledgement | default('0') | int > 0 %}
acknowledgement: {{ icingadb_retention.options.acknowledgement }}
{% endif %}
{% if icingadb_retention.options.comment is defined and
icingadb_retention.options.comment | default('') | length > 0 %}
icingadb_retention.options.comment | default('0') | int > 0 %}
comment: {{ icingadb_retention.options.comment }}
{% endif %}
{% if icingadb_retention.options.downtime is defined and
icingadb_retention.options.downtime | default('') | length > 0 %}
icingadb_retention.options.downtime | default('0') | int > 0 %}
downtime: {{ icingadb_retention.options.downtime }}
{% endif %}
{% if icingadb_retention.options.flapping is defined and
icingadb_retention.options.flapping | default('') | length > 0 %}
icingadb_retention.options.flapping | default('0') | int > 0 %}
flapping: {{ icingadb_retention.options.flapping }}
{% endif %}
{% if icingadb_retention.options.notification is defined and
icingadb_retention.options.notification | default('') | length > 0 %}
icingadb_retention.options.notification | default('0') | int > 0 %}
notification: {{ icingadb_retention.options.notification }}
{% endif %}
{% if icingadb_retention.options.state is defined and
icingadb_retention.options.state | default('') | length > 0 %}
icingadb_retention.options.state | default('0') | int > 0 %}
state: {{ icingadb_retention.options.state }}
{% endif %}
{% endif %}
7 changes: 4 additions & 3 deletions vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ icingadb_installed: false
icingadb_install_dir: /usr/share/icingadb

icingadb_defaults_database:
host: localhost
host: 127.0.0.1
port: 3306
database: icingadb
user: icingadb
password: icingadb

icingadb_defaults_redis:
address: localhost:6380
host: 127.0.0.1
port: 6379

icingadb_defaults_logging:
level: info
Expand All @@ -36,7 +37,7 @@ icingadb_defaults_logging:
dump_signals: fatal

icingadb_defaults_retention:
history_days: "10d"
history_days: ""
sla_days: ""
options:
acknowledgement: ""
Expand Down

0 comments on commit d60d916

Please sign in to comment.