Skip to content

Commit

Permalink
Feature/business process module (Icinga#196)
Browse files Browse the repository at this point in the history
* Add feature to enable business process module and copy existing configuration to the module

* add molecule testing for business process module

* add documentation and changelog
  • Loading branch information
christoph2497 authored Oct 18, 2023
1 parent 7314e49 commit 0249677
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
major_changes:
- Added Installation of Business Process Modeling Module
36 changes: 36 additions & 0 deletions doc/role-icingaweb2/module-businessprocess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## Module Icinga Business Process Modeling

The module Icinga Business Process Modeling provides a visualization for hierarchical business processes based on objects monitored by Icinga.

## Configuration

The general module parameter like `enabled` and `source` can be applied here.

For every config file, create a dictionary with sections as keys and the parameters as values. For all parameters please check the [module documentation](https://icinga.com/docs/icinga-business-process-modeling/latest/doc/01-About/)



Example:
```
icingaweb2_modules:
businessprocess:
enabled: true
source: package
```

### Custom Process Files:

Custom process files are a great way to transfer existing business process configurations into the Business Process Modeling Module.

To copy existing processes into the processes folder please use the `custom_process_files` dictionary.

The `src_path` will search within any `files/` directory in the Ansible environment.
```
icingaweb2_modules:
businessprocess:
enabled: true
source: package
custom_process_files:
- name: test.conf
src_path: processes/test.conf
```
7 changes: 7 additions & 0 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
- zones.d/main/commands
- zones.d/main/hosts
- zones.d/main/services
icingaweb2_modules:
businessprocess:
enabled: true
source: package
custom_process_files:
- name: test.conf
src_path: test.conf
collections:
- icinga.icinga
pre_tasks:
Expand Down
14 changes: 14 additions & 0 deletions molecule/default/files/test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Business Process Config File ###
#
# Title : test
# Description : test
# Owner : icinga
# AddToMenu : yes
# Statetype : soft
#
###################################

test2 =
display 1;test2;test2
webserver =
display 1;webserver;webserver
28 changes: 28 additions & 0 deletions roles/icingaweb2/tasks/modules/businessprocess.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- name: Module Icinga Business Process Modeling | Ensure config directory
ansible.builtin.file:
state: directory
dest: "{{ icingaweb2_modules_config_dir }}/{{ item.key }}"
owner: "{{ icingaweb2_httpd_user }}"
group: "{{ icingaweb2_group }}"
mode: "2770"

- name: Module Icinga Business Process Modeling | Ensure processes directory
ansible.builtin.file:
state: directory
dest: "{{ icingaweb2_modules_config_dir }}/{{ item.key }}/processes"
owner: "{{ icingaweb2_httpd_user }}"
group: "{{ icingaweb2_group }}"
mode: "2770"

- name: Module Icinga Business Process Modeling | Copy Process
ansible.builtin.copy:
owner: "{{ icingaweb2_httpd_user }}"
group: "{{ icingaweb2_group }}"
src: "files/{{ _file.src_path }}"
dest: "{{ icingaweb2_modules_config_dir }}/{{ item.key }}/processes/{{ _file.name }}"
when: vars['icingaweb2_modules'][_module]['custom_process_files'] is defined
loop: "{{ vars['icingaweb2_modules'][_module]['custom_process_files'] }}"
loop_control:
loop_var: _file
vars:
_module: "{{ item.key }}"
1 change: 1 addition & 0 deletions roles/icingaweb2/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
icingaweb2_module_packages:
icingadb: icingadb-web
director: icinga-director
businessprocess: icinga-businessprocess

0 comments on commit 0249677

Please sign in to comment.