Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions icinga2/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ icinga2:
- php-intl
- php-gd
- php-imagick
- git
features:
api: False
command: True
Expand All @@ -59,6 +60,8 @@ icinga2:
perfdata: False
statusdata: False
syslog: False
modules_repo: https://github.com/Icinga/icingaweb2-module- # ${modulename}.git is appended
modules:

check_command:
openvpn:
Expand Down
11 changes: 11 additions & 0 deletions icinga2/icinga-web2-modules.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% from "icinga2/map.jinja" import icinga2 with context %}
{% from "icinga2/map.jinja" import module with context %}

{% for name, data in icinga2.icinga_web2.modules.items() %}
{{ module( name,
data.get("repo", icinga2.icinga_web2.modules_repo + name + ".git"),
data.version,
data.get("path", icinga2.icinga_web2.modules_dir + "/" + name),
data.get("enable", true)
) }}
{% endfor %}
1 change: 1 addition & 0 deletions icinga2/icinga-web2.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ include:
- .pgsql-ido
- .icinga-web2-core
- .icinga-web2-database
- .icinga-web2-modules
20 changes: 20 additions & 0 deletions icinga2/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,23 @@
- watch_in:
- service: icinga2_service_restart
{%- endmacro %}

{%- macro module(name, repo, branch, path, enable) %}
{%- set action = 'enable' if enable else 'disable' %}
"icingaweb2_module_{{ name }}":
{% if action == "enable" %}
git.latest:
- name: {{ repo }}
- target: {{ path }}
- rev: {{ branch }}
- require:
- pkg: icinga2-web2
{% endif %}
cmd.run:
- name: icingacli module {{ action }} {{ name }}
- unless: "icingacli module list | grep '^{{ name }} .* enabled '"
{% if action == "enable" %}
- require:
- git: icingaweb2_module_{{ name }}
{% endif %}
{%- endmacro %}
6 changes: 6 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ icinga2:
perfdata: True
statusdata: True
# ...
modules:
incubator:
version: v0.5.0 # tag or branch
enable: true # optional
repo: https://github.com/Icinga/icingaweb2-module-incubator.git # optional
path: /usr/share/icingaweb2/modules/incubator # optional

notification:
xmpp:
Expand Down