-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathipg.tf
89 lines (69 loc) · 3.82 KB
/
ipg.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
Creating IPG
*/
resource "aci_leaf_access_port_policy_group" "ipg_policy" { # IPG
name = local.igp_policy
relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id
relation_infra_rs_lldp_if_pol = aci_lldp_interface_policy.lldp_policy[0].id
relation_infra_rs_att_ent_p = aci_attachable_access_entity_profile.aaep.id
count = local.cdp_policy_condition == true && local.lldp_policy_condition == true ? 1 : 0
#|| local.cdp_policy_condition == false && local.lldp_policy_condition == true ? aci_leaf_access_port_policy_group.ipg_lldp_policy : 0 #|| local.lldp_policy_condition == false && local.cdp_policy_condition == true ? "relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id" : 0 #Create the IPG and connected to AAEP
lifecycle {
ignore_changes = all
}
}
resource "aci_leaf_access_port_policy_group" "ipg_policy_lldp" { # IPG
name = local.igp_policy
relation_infra_rs_lldp_if_pol = aci_lldp_interface_policy.lldp_policy[0].id
relation_infra_rs_att_ent_p = aci_attachable_access_entity_profile.aaep.id
count = local.cdp_policy_condition == false && local.lldp_policy_condition == true ? 1 : 0 #|| local.cdp_policy_condition == false && local.lldp_policy_condition == true ? aci_leaf_access_port_policy_group.ipg_lldp_policy : 0 #|| local.lldp_policy_condition == false && local.cdp_policy_condition == true ? "relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id" : 0 #Create the IPG and connected to AAEP
lifecycle {
ignore_changes = all
}
}
resource "aci_leaf_access_port_policy_group" "ipg_policy_cdp" { # IPG
name = local.igp_policy
relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id
relation_infra_rs_att_ent_p = aci_attachable_access_entity_profile.aaep.id
count = local.cdp_policy_condition == true && local.lldp_policy_condition == false ? 1 : 0 #|| local.cdp_policy_condition == false && local.lldp_policy_condition == true ? aci_leaf_access_port_policy_group.ipg_lldp_policy : 0 #|| local.lldp_policy_condition == false && local.cdp_policy_condition == true ? "relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id" : 0 #Create the IPG and connected to AAEP
lifecycle {
ignore_changes = all
}
}
output "ipg_policy" {
value = aci_leaf_access_port_policy_group.ipg_policy
description = "The private IP address of the main server instance."
depends_on = [
# Security group rule must be created before this IP address could
# actually be used, otherwise the services will be unreachable.
aci_leaf_access_port_policy_group.ipg_policy
]
}
output "ipg_policy_cdp" {
value = aci_leaf_access_port_policy_group.ipg_policy_cdp
description = "The private IP address of the main server instance."
depends_on = [
# Security group rule must be created before this IP address could
# actually be used, otherwise the services will be unreachable.
aci_leaf_access_port_policy_group.ipg_policy_cdp
]
}
output "ipg_policy_lldp" {
value = aci_leaf_access_port_policy_group.ipg_policy_lldp
description = "The private IP address of the main server instance."
depends_on = [
# Security group rule must be created before this IP address could
# actually be used, otherwise the services will be unreachable.
aci_leaf_access_port_policy_group.ipg_policy_lldp
]
}
/*
resource "aci_leaf_access_port_policy_group" "ipg_lldp_policy" { # IPG
name = local.igp_policy
relation_infra_rs_lldp_if_pol = aci_lldp_interface_policy.lldp_policy[0].id
}
resource "aci_leaf_access_port_policy_group" "ipg_cdp_policy" { # IPG
name = local.igp_policy
relation_infra_rs_cdp_if_pol = aci_cdp_interface_policy.cdp[0].id
}
*/