icinga2_host: Don't set template attribute on modification, it's not permitted (#33989)

This commit is contained in:
Loïc Blot 2017-12-18 22:40:56 +01:00 committed by ansibot
parent 3af028fdd7
commit b25e333076

View file

@ -81,6 +81,7 @@ options:
template:
description:
- The template used to define the host.
- Template cannot be modified after object creation.
required: false
default: None
check_command:
@ -294,7 +295,12 @@ def main():
elif icinga.diff(name, data):
if module.check_mode:
module.exit_json(changed=False, name=name, data=data)
# Template attribute is not allowed in modification
del data['attrs']['templates']
ret = icinga.modify(name, data)
if ret['code'] == 200:
changed = True
else: