-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate config before restarting icinga (#349)
* Only reload icinga2 if config validation is ok * Remove unused handler * Fix ansible lint issues (FQCN and uppercase name) * Fixes #347
- Loading branch information
1 parent
074e37d
commit 5958936
Showing
4 changed files
with
19 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
--- | ||
- name: restart icinga2 service | ||
service: | ||
name: icinga2 | ||
state: restarted | ||
- name: Check icinga2 configuration | ||
ansible.builtin.command: | ||
cmd: icinga2 daemon --validate | ||
register: icinga2_check | ||
changed_when: true | ||
failed_when: icinga2_check.rc != 0 | ||
listen: check-and-reload-icinga2-service | ||
notify: reload-icinga2 | ||
|
||
- name: reload icinga2 service | ||
service: | ||
- name: Reload icinga2 service | ||
ansible.builtin.service: | ||
name: icinga2 | ||
state: reloaded | ||
listen: reload-icinga2 |
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
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
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