netascode / terraform-aci-nac-aci

Terraform Cisco ACI Nexus-as-Code Module
https://registry.terraform.io/modules/netascode/nac-aci/aci
Apache License 2.0
21 stars 24 forks source link

question: folder custom file modules.yaml in cisco ACI nexus as code #82

Closed micronemo closed 6 months ago

micronemo commented 6 months ago

I would like to know in which folder I have to put the custom modules.yaml file since it only uses the one inside the .terraform folder which enables all the modules creating resources not required with the default setting. also I would like to know how the external bridge domains can be created since it seems to be an absent feature

danischm commented 6 months ago

Can be any folder or file referenced by the yaml_files or yaml_directories module attribute. Not sure what you are referring to by "external bridge domains".

micronemo commented 6 months ago

I cannot put the modules.yaml anywhere as it does not overwrite the settings in the modules.yaml file present in .terraform/modules/aci/defaults where all modules are in true for example if I put in my yaml file aci_aaa: false, terraform will still try to create the module since it is active in the default yaml file

fabric-> access policies-> physical and external domains -> external bridged domain there is no module for this

danischm commented 6 months ago

Whatever you have in your "data" files/directories should always overwrite what is included in the module defaults. Could you share the content of your modules.yaml and main.tf file as well as the plan output?

danischm commented 6 months ago

"External bridge domain" is a legacy feature for tenant l2outs which is typically not used nowadays.

micronemo commented 6 months ago

main.tf required_providers { aci = { source = "CiscoDevNet/aci" } } }

locals { apic_config = yamldecode(file("${path.module}/data/defaults/apic.yaml")) }

provider "aci" { username = local.apic_config.apic.credentials.username password = local.apic_config.apic.credentials.password url = local.apic_config.apic.credentials.url insecure = true }

module "aci" { source = "netascode/nac-aci/aci"

yaml_directories = ["data"]

manage_access_policies = true manage_fabric_policies = true manage_pod_policies = false manage_node_policies = false manage_interface_policies = false manage_tenants = true

data/defaults/modules.yaml

modules: aci_aaa: false

plan:

module.aci.module.aci_aaa[0].aci_rest_managed.aaaAuthRealm will be created

danischm commented 6 months ago

Try to put the modules.yaml file directly in the data/ directory, not a data/defaults/ subdirectory.

micronemo commented 6 months ago

thanks i try and woks only in main folder data/

micronemo commented 6 months ago

i solve the problem with this command in the main.tf yaml_directories = ["data", "defaults"]