Skip to content

Commit 2cd375b

Browse files
authored
Merge pull request #32 from T-Systems-MMS/new_service_module
add new service module
2 parents 8d2ed56 + 561ac0e commit 2cd375b

21 files changed

Lines changed: 658 additions & 79 deletions

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Currently supported modules:
1717
* `icinga_host`
1818
* `icinga_hostgroup`
1919
* `icinga_notification`
20+
* `icinga_service`
2021
* `icinga_service_apply`
2122
* `icinga_service_template`
2223
* `icinga_servicegroup`

examples/icinga_service.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
- name: create service
3+
tags: service
4+
icinga_service:
5+
state: present
6+
url: "{{ icinga_url }}"
7+
url_username: "{{ icinga_user }}"
8+
url_password: "{{ icinga_pass }}"
9+
object_name: fooservice
10+
use_agent: true
11+
host: foohost
12+
vars:
13+
procs_argument: consul
14+
procs_critical: '1:'
15+
procs_warning: '1:'

examples/icinga_service_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- name: create servicetemplate
33
tags: servicetemplate
44
icinga_service_template:
5+
state: present
56
url: "{{ icinga_url }}"
67
url_username: "{{ icinga_user }}"
78
url_password: "{{ icinga_pass }}"

plugins/module_utils/icinga.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def call_url(self, path, data="", method="GET"):
4343
try:
4444
content = json.loads(info["body"])
4545
error = content["error"]
46-
except ValueError:
46+
except (ValueError, KeyError):
4747
error = info["msg"]
4848
if info["status"] < 0:
4949
error = info["msg"]

0 commit comments

Comments
 (0)