diff --git a/icinga2/defaults.yaml b/icinga2/defaults.yaml index 00108e1..8e991dc 100644 --- a/icinga2/defaults.yaml +++ b/icinga2/defaults.yaml @@ -47,18 +47,19 @@ icinga2: - php-intl - php-gd - php-imagick - features: - api: False - command: True - debuglog: False - gelf: False - graphite: False - influxdb: False - livestatus: False - opentsdb: False - perfdata: False - statusdata: False - syslog: False + + features: + api: False + command: True + debuglog: False + gelf: False + graphite: False + influxdb: False + livestatus: False + opentsdb: False + perfdata: False + statusdata: False + syslog: False check_command: openvpn: diff --git a/icinga2/features.sls b/icinga2/features.sls new file mode 100644 index 0000000..0567188 --- /dev/null +++ b/icinga2/features.sls @@ -0,0 +1,8 @@ +{% from "icinga2/map.jinja" import icinga2 with context %} +{% from "icinga2/map.jinja" import feature with context %} + +{%- if icinga2.features != None %} +{%- for name, enable in icinga2.features.items() %} +{{ feature(name, enable) }} +{% endfor %} +{%- endif %} diff --git a/icinga2/icinga-web2-core.sls b/icinga2/icinga-web2-core.sls index ef79bd8..8f52af1 100644 --- a/icinga2/icinga-web2-core.sls +++ b/icinga2/icinga-web2-core.sls @@ -12,10 +12,6 @@ icinga2-web2: pkg.installed: - pkgs: {{ icinga2.icinga_web2.pkgs | json }} -{%- for name, enable in icinga2.icinga_web2.features.items() %} -{{ feature(name, enable) }} -{% endfor %} - icingaweb2-group: group.present: - name: {{ icinga2.icinga_web2.group }} diff --git a/icinga2/init.sls b/icinga2/init.sls index 19e4ed2..712031f 100644 --- a/icinga2/init.sls +++ b/icinga2/init.sls @@ -1,4 +1,5 @@ include: - .install - .config + - .features - .service diff --git a/pillar.example b/pillar.example index b4d5a1d..645a56e 100644 --- a/pillar.example +++ b/pillar.example @@ -16,15 +16,16 @@ icinga2: - ... required_pkgs: - ... - features: - api: False # disable - command: True # enable - gelf: True - graphite: True - opentsdb: True - perfdata: True - statusdata: True - # ... + + features: + api: False # disable + command: True # enable + gelf: True + graphite: True + opentsdb: True + perfdata: True + statusdata: True + # ... notification: xmpp: