Created
March 17, 2020 07:43
-
-
Save bodsch/a3641af34b769af5f8bb8c3fb4bbf6b9 to your computer and use it in GitHub Desktop.
ansible blank lines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// {{ ansible_managed }} | |
{% if icinga2_notification_apply.host_notification %} | |
apply Notification "slack-host-notification" to Host { | |
{%- for k, v in icinga2_notification_apply.host_notification.items() -%} | |
{% if k == 'import' %} | |
{{ k }} = "{{ v }}" | |
{% elif k == 'assign_where' %} | |
assign where {{ v }} | |
{% else %} | |
{{ k }} = {{ v }} | |
{% endif %} | |
{%- endfor -%} | |
} | |
{% endif %} | |
// --- | |
{% if icinga2_notification_apply.service_notification %} | |
apply Notification "slack-service-notification" to Service { | |
{%- for k, v in icinga2_notification_apply.service_notification.items() -%} | |
{% if k == 'import' %} | |
{{ k }} = "{{ v }}" | |
{% elif k == 'assign_where' %} | |
assign where {{ v }} | |
{% else %} | |
{{ k }} = {{ v }} | |
{% endif %} | |
{%- endfor -%} | |
} | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icinga2_notification_apply: | |
host_notification: | |
import: slack-host-notification | |
interval: 2h | |
assign_where: host.vars.notification.slack | |
service_notification: | |
import: slack-service-notification | |
interval: 2h | |
assign_where: host.vars.notification.slack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ansible managed: Do NOT edit this file manually! | |
apply Notification "slack-host-notification" to Host { import = "slack-host-notification" | |
interval = 2h | |
assign where host.vars.notification.slack | |
} | |
// --- | |
apply Notification "slack-service-notification" to Service { import = "slack-service-notification" | |
interval = 2h | |
assign where host.vars.notification.slack | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try and error
this works: