Icingacli create host with multiple imports --> Is it possible?

Trying to run this cmd (which succeeds)… however it is stripping/removing the first template import.
Is it possible to create a host object with multiple imports?

sudo icingacli director host create “hostname” --json ‘{“imports":“icon_rhel_vhost”, “imports”:"unix”, “address”:“1.2.3.4”, “vars”:{“os”:“linux”, “disks”:{“disk”:"{}"}, “filesystem”:{"/":{}, “/export”:{}, “/var”:{}, “/var/log”:{}}, “client_endpoint”:“name”, “program”:“poc”, “location”:“somewhere”, “type”:“virtual”}}’

Output:
[user@icinga01 2468]$ sudo icingacli director host show hostname

object Host "hostname" {
     import "unix"
 
     address = "1.2.3.4"
     vars.client_endpoint = "name"
     vars.disks = {
         disk = "{}"
     }
     vars.filesystem = {
         "/" = {}
         "/export" = {}
         "/var" = {}
         "/var/log" = {}
     }
     vars.location = "somwhere"
     vars.os = "linux"
     vars.program = "poc"
     vars.type = "virtual"
 }

Brainfart…
figured it out.

sudo icingacli director host create “hostname” --json ‘{“ imports":[“icon_rhel_vhost”, "unix] ”, “address”:“1.2.3.4”, “vars”:{“os”:“linux”, “disks”:{“disk”:"{}"}, “filesystem”:{"/":{}, “/export”:{}, “/var”:{}, “/var/log”:{}}, “client_endpoint”:“name”, “program”:“poc”, “location”:“somewhere”, “type”:“virtual”}}’

1 Like