Icinga / terraform-provider-icinga2

Terraform Icinga2 provider
https://www.terraform.io/docs/providers/icinga2/
Mozilla Public License 2.0
21 stars 20 forks source link

icinga2 Provider, Host resource bug #1

Closed hashibot closed 5 years ago

hashibot commented 7 years ago

This issue was originally opened by @robrankin as hashicorp/terraform#14819. It was migrated here as part of the provider split. The original body of the issue is below.


The Icinga2 Host resource creates an Icinga2 Host object as follows:

object Host "host" {
    action_url = ""
    address = "192.168.1.1"
    address6 = ""
    check_command = "hostalive"
    display_name = ""
    groups = null
    notes = ""
    notes_url = ""
    templates = null
    vars = {
        something = "blart"
    }
    version = 1495628446.109900
    zone = "master"
}

The groups = null syntax does not appear to be valid. When attempting to use Icinga2's group assign functionality, assign where, to assign the above Host object to Hostgroup object, the groups = null entry causes Icinga2 to segfault.

As far as I can tell so far it's only acceptable for the groups parameter to have a non-empty list of 1 or more members.

groups = ["",] does not work for example.

Icinga2 bug report here: Icinga2 Issue hashicorp/terraform#5288

Terraform Version

Terraform v0.9.4

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "icinga2_host" "host" {
  hostname      = "${var.hostname}"
  address       = "${var.address}"
  check_command = "${var.checkCommand}"

  vars {
    something = "blart"
  }
}

Expected Behavior

The Icinga2 Host resource creates correct Icinga2 object syntax

Actual Behavior

The Icinga2 Host resource creates incorrect Icinga2 object syntax

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

References

https://github.com/Icinga/icinga2/issues/5288

lrsmith commented 6 years ago

This has been vendor'd out to a release which did not require it. Also https://github.com/lrsmith/go-icinga2-api has been modified and versioned as v0.2.x to support not requiring having groups. So this should be resolved.

rayterrill commented 6 years ago

@lrsmith I'm running into the groups = null error when trying to create hosts in Icinga. I see it looks like you fixed in the underlying go-icinga2-api library - did this not get released yet in the provider?

rayterrill commented 6 years ago

@lrsmith Any word on this one mate?

lrsmith commented 6 years ago

@rayterrill This has been merged into master ( https://github.com/terraform-providers/terraform-provider-icinga2/pull/14 ) but a release has not been cut yet for it. I hope to cut a release soon with all the recent PRs.

jc1arke commented 5 years ago

@lrsmith any news on a new release?

lrsmith commented 5 years ago

@jc1arke @rayterrill I am working on getting a new release. Right now the build pipeline is failing and I'm don't have the needed permissions to make the needed changes and I'm working to get the needed changes made.

lrsmith commented 5 years ago

Should be resolved with todays 0.2.0 release