Skip to content

Commit 074841a

Browse files
authored
Add check_interval parameter to host_template (#95)
1 parent e393515 commit 074841a

8 files changed

Lines changed: 14 additions & 0 deletions

File tree

examples/icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display_name: foohosttemplate
1010
disabled: false
1111
check_command: dummy
12+
check_interval: 90s
1213
groups:
1314
- "foohostgroup"
1415
imports:

plugins/modules/icinga_host_template.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
- The name of the check command.
7878
- Though this is not required to be defined in the director, you still have to supply a check_command in a host or host-template.
7979
type: str
80+
check_interval:
81+
description:
82+
- Your regular check interval.
83+
type: str
8084
disabled:
8185
description:
8286
- Disabled objects will not be deployed.
@@ -139,6 +143,7 @@
139143
display_name: foohosttemplate
140144
disabled: false
141145
check_command: dummy
146+
check_interval: 90s
142147
groups:
143148
- "foohostgroup"
144149
imports:
@@ -173,6 +178,7 @@ def main():
173178
display_name=dict(required=False),
174179
groups=dict(type="list", elements="str", default=[], required=False),
175180
check_command=dict(required=False),
181+
check_interval=dict(required=False),
176182
imports=dict(type="list", elements="str", required=False),
177183
disabled=dict(type="bool", default=False, choices=[True, False]),
178184
address=dict(required=False),
@@ -197,6 +203,7 @@ def main():
197203
"display_name": module.params["display_name"],
198204
"groups": module.params["groups"],
199205
"check_command": module.params["check_command"],
206+
"check_interval": module.params["check_interval"],
200207
"imports": module.params["imports"],
201208
"disabled": module.params["disabled"],
202209
"address": module.params["address"],

roles/ansible_icinga/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ t_systems_mms.icinga_director >= 1.2.2
7777
| address6 | no |
7878
| groups | no |
7979
| check_command | no |
80+
| check_interval | no |
8081
| disabled | no |
8182
| imports | no |
8283
| zone | no |

roles/ansible_icinga/tasks/icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
address6: "{{ host_template.0.address6 | default(omit) }}"
1919
groups: "{{ host_template.0.address | default(omit) }}"
2020
check_command: "{{ host_template.0.check_command | default(omit) }}"
21+
check_interval: "{{ host_template.0.check_interval | default(omit) }}"
2122
disabled: "{{ host_template.0.disabled | default(omit) }}"
2223
imports: "{{ host_template.0.imports | default(omit) }}"
2324
zone: "{{ host_template.0.zone | default(omit) }}"

tests/integration/targets/icinga/roles/icinga/tasks/absent_icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display_name: foohosttemplate
1010
disabled: false
1111
check_command: dummy
12+
check_interval: 90s
1213
groups:
1314
- "foohostgroup"
1415
notes: "example note"

tests/integration/targets/icinga/roles/icinga/tasks/icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display_name: foohosttemplate
1010
disabled: false
1111
check_command: dummy
12+
check_interval: 90s
1213
groups:
1314
- "foohostgroup"
1415
imports:

tests/integration/targets/icinga/roles/icinga/tasks/wrong_host_icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display_name: foohosttemplate
1010
disabled: false
1111
check_command: dummy
12+
check_interval: 90s
1213
groups:
1314
- "foohostgroup"
1415
imports:

tests/integration/targets/icinga/roles/icinga/tasks/wrong_pass_icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display_name: foohosttemplate
1010
disabled: false
1111
check_command: dummy
12+
check_interval: 90s
1213
groups:
1314
- "foohostgroup"
1415
imports:

0 commit comments

Comments
 (0)