Skip to content

Commit

Permalink
chore: Fix CI, rebranding (#122)
Browse files Browse the repository at this point in the history
* ci: Fix CI

* chore: Rebranding

* fix: Fix tests

* docs: Fix status badge

* fix: Add requirements.yml
  • Loading branch information
gianklug authored Dec 20, 2023
1 parent 20de035 commit 5c0a0c9
Show file tree
Hide file tree
Showing 17 changed files with 215 additions and 238 deletions.
5 changes: 3 additions & 2 deletions .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
skip_list:
- '204'
- '201'
- "204"
- "201"
35 changes: 7 additions & 28 deletions .github/workflows/ansible-ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@
---
name: CI - Linting

on:
'on':
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
# This workflow contains a single job called "build"
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
path: icinga2_master

# Checkout Adfinis lint-rules
- uses: actions/checkout@v2
with:
repository: adfinis-sygroup/ansible-lint-rules
path: lint-rules

- name: ansible-lint
uses: ansible/ansible-lint-action@master
with:
targets: icinga2_master
args: "-R -r lint-rules"
override-deps: |
ansible~=2.10
ansible-lint~=5.0
- name: yamllint
uses: karancode/yamllint-github-action@v2.0.0
with:
yamllint_config_filepath: icinga2_master/.testenv/yamllint.yml
yamllint_file_or_dir: icinga2_master
- name: Checkout
uses: actions/checkout@v4
- name: Run ansible-lint
uses: ansible/ansible-lint@main
3 changes: 2 additions & 1 deletion .github/workflows/galaxy-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
- name: checkout
uses: actions/checkout@v2
- name: galaxy
uses: robertdebock/galaxy-action@1.1.0
uses: robertdebock/galaxy-action@1.2.1
with:
galaxy_api_key: ${{ secrets.galaxy_api_key }}
git_branch: master
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
ROLE ICINGA2\_MASTER
====================

[![image](https://img.shields.io/github/license/adfinis-sygroup/ansible-role-icinga2_master.svg?style=flat-square)](https://github.com/adfinis-sygroup/ansible-role-icinga2_master/blob/master/LICENSE)
[![image](https://img.shields.io/github/license/adfinis/ansible-role-icinga2_master.svg?style=flat-square)](https://github.com/adfinis/ansible-role-icinga2_master/blob/master/LICENSE)

[![image](https://img.shields.io/github/workflow/status/adfinis-sygroup/ansible-role-icinga2_master/CI%20-%20Linting?style=flat-square)](https://github.com/adfinis-sygroup/ansible-role-icinga2_master/actions)
[![image](https://img.shields.io/github/actions/workflow/status/adfinis/ansible-role-icinga2_master/ansible-ci.yml?style=flat-square)](https://github.com/adfinis/ansible-role-icinga2_master/actions)

[![image](https://img.shields.io/badge/galaxy-adfinis--sygroup.icinga2_master-660198.svg?style=flat-square)](https://galaxy.ansible.com/adfinis-sygroup/icinga2_master)
[![image](https://img.shields.io/badge/galaxy-adfinis.icinga2_master-660198.svg?style=flat-square)](https://galaxy.ansible.com/adfinis/icinga2_master)

This role configures icinga2 to act as a master. Furthermore, this role
takes care of the configuration for all clients.
Expand All @@ -18,14 +18,14 @@ activate the [IDO
feature](https://icinga.com/docs/icinga2/latest/doc/14-features/#db-ido)
for icinga2. This needs a running database, either already existing or
using the
[adfinis-sygroup.mariadb](https://galaxy.ansible.com/adfinis-sygroup/mariadb)
[adfinis.mariadb](https://galaxy.ansible.com/adfinis/mariadb)
role. Note: When using a multi-master setup, only one database must be
used for both instances!

Role Variables
--------------

``` {.sourceCode .yaml}
```yaml
# The icinga2 master zone
icinga2_master_master_zone: monitoring-master

Expand All @@ -41,7 +41,7 @@ icinga2_master_api_users: []

Templates can be adjusted using variables.

``` {.sourceCode .yaml}
```yaml
## Template settings

# If you have own templates for the configuration files in /etc/icinga2/conf.d
Expand All @@ -67,7 +67,7 @@ SID and Auth token from the twilio console. If you plan to make phone
calls, please create a [TwiML](https://www.twilio.com/docs/voice/twiml)
application.
``` {.sourceCode .yaml}
```yaml
## Twilio alerting

# The account sid from https://www.twilio.com/console
Expand Down Expand Up @@ -98,7 +98,7 @@ icinga2_master_twilio_phone_enabled: False
# The twilio phone number used to make calls
#icinga2_master_twilio_phone_from: '+41123456789'

# The twilio application on how to handle the call. You can either choose
# The twilio application on how to handle the call. You can either choose
# application sid or appication url. Choose only one. default is not defined.
# https://www.twilio.com/docs/voice/make-calls
#icinga2_master_twilio_phone_application_sid: 'application_sid'
Expand All @@ -119,29 +119,29 @@ Dependencies
------------

This role depends on the role
[adfinis-sygroup.icinga2\_agent](https://galaxy.ansible.com/adfinis-sygroup/icinga2_agent),
[adfinis.icinga2\_agent](https://galaxy.ansible.com/adfinis/icinga2_agent),
which installs the icinga2 binary.

Example Playbook
----------------

``` {.sourceCode .yaml}
```yaml
- hosts: monitoring-master
roles:
- { role: adfinis-sygroup.icinga2_agent }
- { role: adfinis-sygroup.icinga2_master }
- { role: adfinis.icinga2_agent }
- { role: adfinis.icinga2_master }
```
License
-------
[GPL-3.0](https://github.com/adfinis-sygroup/ansible-role-icinga2_master/blob/master/LICENSE)
[GPL-3.0](https://github.com/adfinis/ansible-role-icinga2_master/blob/master/LICENSE)
Author Information
------------------
icinga2\_master role was written by:
- Adfinis SyGroup AG \| [Website](https://www.adfinis-sygroup.ch/) \|
[Twitter](https://twitter.com/adfinissygroup) \|
[GitHub](https://github.com/adfinis-sygroup)
- Adfinis AG \| [Website](https://www.adfinis.com/) \|
[Twitter](https://twitter.com/adfinis) \|
[GitHub](https://github.com/adfinis)
70 changes: 34 additions & 36 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ icinga2_master_client_parent_zone: "{{ icinga2_master_master_zone }}"
# https://icinga.com/docs/icinga2/latest/doc/09-object-types/#user
icinga2_master_users:
- name: icingaadmin
email: 'alertme@example.com'
email: alertme@example.com
groups:
- icingaadmins
# icinga2_master_users:
Expand Down Expand Up @@ -47,7 +47,7 @@ icinga2_master_users:
# https://icinga.com/docs/icinga2/latest/doc/09-object-types/#usergroup
icinga2_master_usergroups:
- name: icingaadmins
displayname: 'Icinga2 Admins'
displayname: Icinga2 Admins
# icinga2_master_usergroups:
# - name: groupname
# displayname: 'Group Name' # optional, defaults to an empty string
Expand Down Expand Up @@ -109,43 +109,43 @@ icinga2_master_timeperiods:
- name: holidays
display_name: Holidays
ranges:
- day: "december 25"
time: 00:00-24:00
- day: december 25
time: "00:00-24:00"
- name: premium
display_name: SLA Premium
ranges:
- day: monday
time: 00:00-24:00
time: "00:00-24:00"
- day: tuesday
time: 00:00-24:00
time: "00:00-24:00"
- day: wednesday
time: 00:00-24:00
time: "00:00-24:00"
- day: thursday
time: 00:00-24:00
time: "00:00-24:00"
- day: friday
time: 00:00-24:00
time: "00:00-24:00"
- day: saturday
time: 00:00-24:00
time: "00:00-24:00"
- day: sunday
time: 00:00-24:00
time: "00:00-24:00"
- name: standard
display_name: SLA Standard
ranges:
- day: monday
time: 08:00-18:00
time: "08:00-18:00"
- day: tuesday
time: 08:00-18:00
time: "08:00-18:00"
- day: wednesday
time: 08:00-18:00
time: "08:00-18:00"
- day: thursday
time: 08:00-18:00
time: "08:00-18:00"
- day: friday
time: 08:00-18:00
time: "08:00-18:00"
excludes:
- holidays

# Enable the graphite writer feature
icinga2_master_graphite_enabled: False
icinga2_master_graphite_enabled: false

# The Host graphite is running on
icinga2_master_graphite_host: 127.0.0.1
Expand All @@ -156,7 +156,7 @@ icinga2_master_graphite_port: 2003
## Icinga2 ido database settings

# Enable ido feature
icinga2_master_ido_enabled: False
icinga2_master_ido_enabled: false

# icinga2 database name
icinga2_master_icinga2_database_name: icinga2
Expand All @@ -171,39 +171,38 @@ icinga2_master_icinga2_database_port: 3306
icinga2_master_icinga2_database_user: icinga2

# icinga2 database password
icinga2_master_icinga2_database_pass: 'passw0rd'
icinga2_master_icinga2_database_pass: passw0rd

# if the database connection uses ssl or not (true or false)
icinga2_master_icinga2_database_ssl: false

# the hostpattern which can access and login with the icinga2 user
icinga2_master_icinga2_database_hostpattern: 'localhost'
icinga2_master_icinga2_database_hostpattern: localhost

# icinga2 database root user
icinga2_master_db_root_user: "user"
icinga2_master_db_root_user: user

# icinga2 database root password
icinga2_master_db_root_pass: "passw0rd"

icinga2_master_db_root_pass: passw0rd

## Template settings

# If you have own templates for the configuration files in /etc/icinga2/conf.d
# consider adjusting the names here and add your template to
# templates/etc/icinga2/conf.d in the root of your playbook folder.
icinga2_master_template_confd_apiusers: "api-users.conf"
icinga2_master_template_confd_notifications: "notifications.conf"
icinga2_master_template_confd_templates: "templates.conf"
icinga2_master_template_confd_commands: "commands.conf"
icinga2_master_template_confd_groups: "groups.conf"
icinga2_master_template_confd_timeperiods: "timeperiods.conf"
icinga2_master_template_confd_users: "users.conf"
icinga2_master_template_confd_apiusers: api-users.conf
icinga2_master_template_confd_notifications: notifications.conf
icinga2_master_template_confd_templates: templates.conf
icinga2_master_template_confd_commands: commands.conf
icinga2_master_template_confd_groups: groups.conf
icinga2_master_template_confd_timeperiods: timeperiods.conf
icinga2_master_template_confd_users: users.conf

# These variables can be adjusted if you have custom templates for the global
# templates directory which gets synced to all clients.
icinga2_master_template_globaltemplates:
- "services.conf"
- "templates.conf"
- services.conf
- templates.conf

# Global Zones to be added to zones.conf
icinga2_master_global_zones:
Expand All @@ -226,7 +225,7 @@ icinga2_master_global_zones:
# icinga2_master_twilio_auth_token: 'auth_token'

# Whether twilio sms are enabled or not
icinga2_master_twilio_sms_enabled: False
icinga2_master_twilio_sms_enabled: false

# The twilio phone numer used to send sms
# icinga2_master_twilio_sms_from: '+41123456789'
Expand All @@ -235,14 +234,13 @@ icinga2_master_twilio_sms_enabled: False
# Can be used to execute custom scripts after the SMS is sent
# defaults to an empty list, add command lines as necessary
# Example:
#icinga2_master_twilio_sms_additional_commands:
# icinga2_master_twilio_sms_additional_commands:
# # Execute a custom script after the sms has been sent to also send
# # the notification to mattermost
# - "/etc/icinga2/scripts/mattermost.sh "${NOTIFICATION_MESSAGE}""
icinga2_master_twilio_sms_additional_commands: []

# Whether twilio calls are enabled or not
icinga2_master_twilio_phone_enabled: False
icinga2_master_twilio_phone_enabled: false

# The twilio phone number used to make calls
# icinga2_master_twilio_phone_from: '+41123456789'
Expand Down
5 changes: 2 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---

- name: icinga2_master reload icinga2
service:
- name: Icinga2_master reload icinga2
ansible.builtin.service:
name: icinga2
state: reloaded
23 changes: 12 additions & 11 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
---

dependencies:
- name: 'adfinis-sygroup.icinga2_agent'
- name: adfinis.icinga2_agent

galaxy_info:
role_name: 'icinga2_master'
author: 'Adfinis SyGroup AG'
description: 'This role is used to configure icinga2 in master mode'
company: 'Adfinis SyGroup AG'
license: 'GNU General Public License v3'
min_ansible_version: '2.0.0'
role_name: icinga2_master
namespace: adfinis
author: Adfinis AG
description: This role is used to configure icinga2 in master mode
company: Adfinis AG
license: GNU General Public License v3
min_ansible_version: 2.0.0
platforms:
- name: EL
versions:
- 7
- "7"
galaxy_tags:
- 'icinga2'
- 'monitoring'
- 'master'
- icinga2
- monitoring
- master
3 changes: 3 additions & 0 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
roles:
- name: adfinis.icinga2_agent
Loading

0 comments on commit 5c0a0c9

Please sign in to comment.