diff --git a/changelogs/fragments/6748-icinga2_host-datafix.yml b/changelogs/fragments/6748-icinga2_host-datafix.yml new file mode 100644 index 0000000000..2aefd55096 --- /dev/null +++ b/changelogs/fragments/6748-icinga2_host-datafix.yml @@ -0,0 +1,2 @@ +bugfixes: + - "icinga2_host - fix a key error when updating an existing host (https://github.com/ansible-collections/community.general/pull/6748)." diff --git a/plugins/modules/icinga2_host.py b/plugins/modules/icinga2_host.py index ce9509cbc6..c7c325ad52 100644 --- a/plugins/modules/icinga2_host.py +++ b/plugins/modules/icinga2_host.py @@ -306,7 +306,7 @@ def main(): module.exit_json(changed=False, name=name, data=data) # Template attribute is not allowed in modification - del data['attrs']['templates'] + del data['templates'] ret = icinga.modify(name, data)