Skip to content

Question - is it possible to incorporate a single variable to a list defined in YAML. #150

@jorgenspange

Description

@jorgenspange

Good day,

For my backup server I want to define the password in locals to leverage a data object.

module "aci" {
  source  = "netascode/nac-aci/aci"
  version = "0.9.1"
  model   = local.model
  yaml_directories = [
    "data/*",
    "data/**/*",
  ]
  manage_access_policies    = true
  manage_fabric_policies    = true
  manage_pod_policies       = true
  manage_node_policies      = true
  manage_interface_policies = true
  manage_tenants            = true
}

locals {
  model = {
    apic = {
      fabric_policies = {
        remote_locations = [{
          name = "backup_server"
          password = data.key_vault.password
        }]
      }
    }
  }
}

and my yaml file looks like this:

---
apic:
  fabric_policies:
    remote_locations:
      - name: backup_server
        hostname_ip: 192.168.1.20
        protocol: sftp
        path: /
        auth_type: password
        username: backup_user
        mgmt_epg: oob

This will try to create 2x objects that is named backup_server, is it possible to instead merge them?

br
Jørgen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions