File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 11locals {
2- domain = try (trimsuffix (var. zone . dns_name , " ." ), " local" )
3- fqdn = " ${ var . name } .${ local . domain } "
2+ fqdn = var. zone != null ? " ${ var . name } .${ trimsuffix (var. zone . dns_name , " ." )} " : null
43 ip_address = var. ip_address != null ? split (" /" , var. ip_address )[0 ] : null
54 ip_prefix = var. ip_address != null ? try (split (" /" , var. ip_address )[1 ], " 32" ) : null
65 tags = var. tags != null ? var. tags : try (data. netbox_cluster . main [0 ]. tags , [])
76}
87
98resource "netbox_virtual_machine" "main" {
10- name = local. fqdn
9+ name = var . zone != null ? local. fqdn : var . name
1110 role_id = data. netbox_device_role . main . id
1211 platform_id = data. netbox_platform . main . id
1312 site_id = var. site != null ? data. netbox_site . main [0 ]. id : null
You can’t perform that action at this time.
0 commit comments