Skip to content

Commit ef24153

Browse files
committed
add support for address6 on host object
1 parent a706e50 commit ef24153

7 files changed

Lines changed: 21 additions & 0 deletions

File tree

examples/icinga_host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
disabled: false
99
object_name: "foohost"
1010
address: "127.0.0.1"
11+
address6: "::1"
1112
display_name: "foohost"
1213
groups:
1314
- "foohostgroup"

plugins/modules/icinga_host.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@
108108
- Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with
109109
required: false
110110
type: str
111+
address6:
112+
description:
113+
- Host IPv6 address. Usually an IPv6 address, but may be any kind of address your check plugin is able to deal with
114+
required: false
115+
type: str
111116
groups:
112117
description:
113118
- Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons.
@@ -158,6 +163,7 @@
158163
disabled: false
159164
object_name: "foohost"
160165
address: "127.0.0.1"
166+
address6: "::1"
161167
display_name: "foohost"
162168
groups:
163169
- "foohostgroup"
@@ -193,6 +199,7 @@ def main():
193199
imports=dict(type="list", required=True),
194200
disabled=dict(type="bool", default=False, choices=[True, False]),
195201
address=dict(required=False),
202+
address6=dict(required=False),
196203
zone=dict(required=False, default=None),
197204
vars=dict(type="dict", default=None),
198205
check_command=dict(required=False),
@@ -211,6 +218,7 @@ def main():
211218
"imports": module.params["imports"],
212219
"disabled": module.params["disabled"],
213220
"address": module.params["address"],
221+
"address6": module.params["address6"],
214222
"zone": module.params["zone"],
215223
"vars": module.params["vars"],
216224
"check_command": module.params["check_command"],

plugins/modules/icinga_host_template.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@
107107
- Host address. Usually an IPv4 address, but may be any kind of address your check plugin is able to deal with
108108
required: false
109109
type: str
110+
address6:
111+
description:
112+
- Host IPv6 address. Usually an IPv64 address, but may be any kind of address your check plugin is able to deal with
113+
required: false
114+
type: str
110115
groups:
111116
description:
112117
- Hostgroups that should be directly assigned to this node. Hostgroups can be useful for various reasons.
@@ -190,6 +195,7 @@ def main():
190195
imports=dict(type="list", required=False),
191196
disabled=dict(type="bool", default=False, choices=[True, False]),
192197
address=dict(required=False),
198+
address6=dict(required=False),
193199
zone=dict(required=False, default=None),
194200
vars=dict(type="dict", default=None),
195201
)
@@ -208,6 +214,7 @@ def main():
208214
"imports": module.params["imports"],
209215
"disabled": module.params["disabled"],
210216
"address": module.params["address"],
217+
"address6": module.params["address6"],
211218
"zone": module.params["zone"],
212219
"vars": module.params["vars"],
213220
}

roles/ansible_icinga/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ t_systems_mms.icinga_director >= 1.2.2
6464
| icinga_host_templates | no | []
6565
| display_name | no |
6666
| address | no |
67+
| address6 | no |
6768
| groups | no |
6869
| check_command | no |
6970
| disabled | no |
@@ -74,6 +75,7 @@ t_systems_mms.icinga_director >= 1.2.2
7475
| icinga_hosts | no | []
7576
| display_name | no |
7677
| address | no |
78+
| address6 | no |
7779
| groups | no |
7880
| disabled | no |
7981
| imports | yes | []

roles/ansible_icinga/tasks/icinga_host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
object_name: "{{ host.1 }}"
1616
display_name: "{{ host.0.display_name | default(omit) }}"
1717
address: "{{ host.0.address | default(omit) }}"
18+
address6: "{{ host.0.address6 | default(omit) }}"
1819
groups: "{{ host.0.groups | default(omit) }}"
1920
disabled: "{{ host.0.disabled | default(omit) }}"
2021
imports: "{{ host.0.imports | default(icinga_host_imports) }}"

roles/ansible_icinga/tasks/icinga_host_template.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
object_name: "{{ host_template.1 }}"
1616
display_name: "{{ host_template.0.display_name | default(omit) }}"
1717
address: "{{ host_template.0.address | default(omit) }}"
18+
address6: "{{ host_template.0.address6 | default(omit) }}"
1819
groups: "{{ host_template.0.address | default(omit) }}"
1920
check_command: "{{ host_template.0.check_command | default(omit) }}"
2021
disabled: "{{ host_template.0.disabled | default(omit) }}"

tests/integration/targets/icinga/tasks/icinga_host.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
disabled: false
99
object_name: "foohost"
1010
address: "127.0.0.1"
11+
address6: "::1"
1112
display_name: "foohost"
1213
groups:
1314
- "foohostgroup"

0 commit comments

Comments
 (0)