Open francisATgwn opened 3 years ago
Using an icinga host template that has custom variables, a host object created through a direct API call with curl inherits the custom vars from the template whereas an equivalent host object created through terraform does not.
> terraform --version Terraform v0.15.4 on linux_amd64 + provider registry.terraform.io/hashicorp/aws v3.30.0 + provider registry.terraform.io/icinga/icinga2 v0.5.0
Please list the resources as a list, for example:
template Host "example" { vars.inherited_from_template = true }
curl -sSLD /dev/stderr \ -u "${ICINGA2_API_USER}:${ICINGA2_API_PASSWORD}" \ -H 'Accept: application/json' \ -X PUT \ "${ICINGA2_API_URL}/objects/hosts/curl-example" \ -d '{ "templates": [ "example" ], "attrs": { "address": "1.1.1.1", "check_command": "dummy", "vars.provided_by_host": "true" }, "pretty": true }'
resource "icinga2_host" "example" { hostname = "terraform-example" address = "1.1.1.1" check_command = "dummy" templates = [ "example" ] vars = { provided_by_host = true } }
The terraformed host should have the same custom vars as the curl-created host
> curl -s\ -u "${ICINGA2_API_USER}:${ICINGA2_API_PASSWORD}" \ -H 'Accept: application/json' \ "${ICINGA2_API_URL}/objects/hosts/curl-example" | jq -S '.results[0].attrs.vars' { "inherited_from_template": true, "provided_by_host": "true" }
> curl -s \ -u "${ICINGA2_API_USER}:${ICINGA2_API_PASSWORD}" \ -H 'Accept: application/json' \ "${ICINGA2_API_URL}/objects/hosts/terraform-example" | jq -S '.results[0].attrs.vars' { "provided_by_host": "true" }
Please list the steps required to reproduce the issue, for example:
any updates or workarounds?
Using an icinga host template that has custom variables, a host object created through a direct API call with curl inherits the custom vars from the template whereas an equivalent host object created through terraform does not.
Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform and Icinga Configuration Files
Expected Behavior
The terraformed host should have the same custom vars as the curl-created host
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example: