-
Notifications
You must be signed in to change notification settings - Fork 17
[ENHANCEMENT] Add support for pce #112 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5f4a9a2
[ENHANCEMENT] Add support for pce #112
18e3d4e
Merge branch 'main' into iosxr_pce
rwcrowe 326c087
Merge branch 'netascode:main' into iosxr_pce
rhuseyn 3dbfa41
[netascode/terraform-iosxr-nac-iosxr] [ENHANCEMENT] Add support for p…
c34f22d
final check
f7b4faa
[netascode/terraform-iosxr-nac-iosxr] [ENHANCEMENT] Add support for p…
c859a12
Merge branch 'main' into pr/57
rocrowe 3ebc03f
refactor(iosxr_pce): remove redundant length checks.
rocrowe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
locals { | ||
device_pces = [ | ||
for device in local.devices : { | ||
device_name = device.name | ||
key = device.name | ||
address_ipv4 = try(local.device_config[device.name].pce.address_ipv4, local.defaults.iosxr.configuration.pce.address_ipv4, null) | ||
address_ipv6 = try(local.device_config[device.name].pce.address_ipv6, local.defaults.iosxr.configuration.pce.address_ipv6, null) | ||
api_authentication_digest = try(local.device_config[device.name].pce.api_authentication_digest, local.defaults.iosxr.configuration.pce.api_authentication_digest, null) | ||
api_sibling_ipv4 = try(local.device_config[device.name].pce.api_sibling_ipv4, local.defaults.iosxr.configuration.pce.api_sibling_ipv4, null) | ||
peer_filter_ipv4_access_list = try(local.device_config[device.name].pce.peer_filter_ipv4_access_list, local.defaults.iosxr.configuration.pce.peer_filter_ipv4_access_list, null) | ||
api_users = try(length(local.device_config[device.name].pce.api_users) == 0, true) ? null : [ | ||
for api_user in try(local.device_config[device.name].pce.api_users, local.defaults.iosxr.configuration.pce.api_users, []) : { | ||
user_name = try(api_user.user_name, null) | ||
password_encrypted = try(api_user.password_encrypted, null) | ||
} | ||
] | ||
state_sync_ipv4s = try(length(local.device_config[device.name].pce.state_sync_ipv4s) == 0, true) ? null : [ | ||
for state_sync_ipv4 in try(local.device_config[device.name].pce.state_sync_ipv4s, []) : { | ||
address = try(state_sync_ipv4.address, null) | ||
} | ||
] | ||
} | ||
if try(local.device_config[device.name].pce, null) != null || try(local.defaults.iosxr.configuration.pce, null) != null | ||
] | ||
} | ||
|
||
resource "iosxr_pce" "pce" { | ||
for_each = { for pce in local.device_pces : pce.key => pce } | ||
|
||
device = each.value.device_name | ||
address_ipv4 = each.value.address_ipv4 | ||
address_ipv6 = each.value.address_ipv6 | ||
api_authentication_digest = each.value.api_authentication_digest | ||
api_sibling_ipv4 = each.value.api_sibling_ipv4 | ||
peer_filter_ipv4_access_list = each.value.peer_filter_ipv4_access_list | ||
api_users = each.value.api_users | ||
state_sync_ipv4s = each.value.state_sync_ipv4s | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.