[icinga-checkins] icinga.org: icinga2-ansible/master: Added ignore keyword to services

git at icinga.org git at icinga.org
Sat Jun 7 13:16:05 CEST 2014


Module: icinga2-ansible
Branch: master
Commit: f84aa31688240b9a32dd2b330f8fddf5c4f5cad9
URL:    https://git.icinga.org/?p=icinga2-ansible.git;a=commit;h=f84aa31688240b9a32dd2b330f8fddf5c4f5cad9

Author: Valentino Gagliardi <valentino.g at servermanaged.it>
Date:   Sun Jun  1 16:14:59 2014 +0200

Added ignore keyword to services

---

 tasks/icinga2_add_host.yml |    3 +--
 templates/host_def.j2      |    2 ++
 templates/http_service.j2  |    2 +-
 templates/smtp_service.j2  |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/tasks/icinga2_add_host.yml b/tasks/icinga2_add_host.yml
index 72d27fd..6efdc62 100644
--- a/tasks/icinga2_add_host.yml
+++ b/tasks/icinga2_add_host.yml
@@ -4,7 +4,6 @@
             owner=root 
             group=root 
             mode=0644
-  with_items: groups['monitored'] 
+  with_items: groups['monitored']
   notify:
    - restart icinga2
-
diff --git a/templates/host_def.j2 b/templates/host_def.j2
index 2dd73b7..09cfdae 100644
--- a/templates/host_def.j2
+++ b/templates/host_def.j2
@@ -3,5 +3,7 @@ object Host "{{ hostvars[item]['ansible_fqdn'] }}" {
   address = "{{ hostvars[item]['ansible_eth0']['ipv4']['address'] }}"
   vars.os = "Linux"
   vars.sla = "24x7"
+  vars.http = "yes"
+  vars.smtp = "yes"
 }
 
diff --git a/templates/http_service.j2 b/templates/http_service.j2
index 60d7d29..9e6532b 100644
--- a/templates/http_service.j2
+++ b/templates/http_service.j2
@@ -2,5 +2,5 @@ apply Service "http" {
   import "generic-service"
   check_command = "http"
   assign where host.vars.http == "yes"
-
+  ignore where host.vars.http == "no"
 }
diff --git a/templates/smtp_service.j2 b/templates/smtp_service.j2
index 3613fcf..9f12887 100644
--- a/templates/smtp_service.j2
+++ b/templates/smtp_service.j2
@@ -2,5 +2,5 @@ apply Service "smtp" {
   import "generic-service"
   check_command = "smtp"
   assign where host.vars.smtp == "yes"
-
+  ignore where host.vars.smtp == "no"
 }



More information about the icinga-checkins mailing list