diff --git a/handlers/main.yml b/handlers/main.yml index ee4b260..386702b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -1,9 +1,11 @@ --- -- name: restart shinken arbiter +- name: Validate configuration + # Service command can't be used as it doesn't support 'check' command: service shinken check + +- name: restart shinken arbiter service: name=shinken-arbiter state=restarted - name: restart shinken broker - command: service shinken check service: name=shinken-broker state=restarted diff --git a/tasks/configure-shinken-webui.yml b/tasks/configure-shinken-webui.yml index a822d8e..fe0a2c2 100644 --- a/tasks/configure-shinken-webui.yml +++ b/tasks/configure-shinken-webui.yml @@ -5,6 +5,7 @@ # template: src=webui-module.cfg.tmpl dest=/etc/shinken/modules/broker-webui.cfg # owner=root group=root mode=444 # notify: +# - Validate configuration # - restart shinken broker # - restart shinken arbiter @@ -41,6 +42,7 @@ regexp='.*[^#] modules.*' line=" modules {{ shinken_broker_modules }}" notify: + - Validate configuration - restart shinken broker - restart shinken arbiter diff --git a/tasks/configure-shinken.yml b/tasks/configure-shinken.yml index 6dbbd8b..9fab1ef 100644 --- a/tasks/configure-shinken.yml +++ b/tasks/configure-shinken.yml @@ -7,6 +7,7 @@ dest={{ shinken_config_contacts }}/{{ item.contact_name |mandatory }}.cfg mode=640 notify: + - Validate configuration - restart shinken arbiter - name: Create configuration for services to monitor @@ -15,6 +16,7 @@ dest={{ shinken_config_services }}/{{ item.service_description|replace(' ', '_') }}.cfg src=services.cfg.tmpl notify: + - Validate configuration - restart shinken arbiter - name: Create configuration for hosts to monitor (without services) @@ -23,6 +25,7 @@ dest={{ shinken_config_hosts }}/{{ item.host_name }}.cfg src=hosts.cfg.tmpl notify: + - Validate configuration - restart shinken arbiter # Following Jinja magic thanks to mikecee @@ -36,6 +39,7 @@ dest={{ shinken_config_hostgroups }}/{{ item }}.cfg src=hostgroups.cfg.tmpl notify: + - Validate configuration - restart shinken arbiter - name: Install 'all' hostgroup @@ -43,6 +47,7 @@ dest={{ shinken_config_hostgroups }}/all.cfg src=hostgroups-all.cfg.tmpl notify: + - Validate configuration - restart shinken arbiter - name: Fix path to nagios plugins directory on RedHat family @@ -53,5 +58,6 @@ line: '$NAGIOSPLUGINSDIR$=/usr/lib64/nagios/plugins' state: present notify: + - Validate configuration - restart shinken arbiter