Skip to content

Commit

Permalink
Interface(Set): Add vsx-sync parameter
Browse files Browse the repository at this point in the history
you can vsx-sync parameter like active-gateway (and ^vsx_virtual.* / virtual_gw_l3_src_mac_enable)
  • Loading branch information
alagoutte committed May 17, 2024
1 parent 514ecbc commit eb867c2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions PowerArubaCX/Public/Interfaces.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ function Set-ArubaCXInterfaces {
[Parameter(Mandatory = $false)]
[Alias('active_gateway')]
[ipaddress[]]$vsx_virtual_ip4,
[Parameter (Mandatory = $false)]
[ValidateSet('active-gateway', IgnoreCase = $false)]
[string[]]$vsx_sync,
[Parameter(Mandatory = $false)]
[string]$vrf,
[Parameter (Mandatory = $false)]
Expand Down Expand Up @@ -789,6 +792,20 @@ function Set-ArubaCXInterfaces {
$_interface.vsx_virtual_ip4 = $ag_ip4
}

if ( $PsBoundParameters.ContainsKey('vsx_sync') ) {
$vsync = @()

foreach ($vs in $vsx_sync) {
if($vs -eq "active-gateway"){
$vsync += "^vsx_virtual.*"
$vsync += "virtual_gw_l3_src_mac_enable"
} else {
$vsync += $vs
}
}
$_interface.vsx_sync = $vsync
}

if ( $PsBoundParameters.ContainsKey('vrf') ) {
$_interface.vrf = "/rest/" + $($connection.api_version) + "/system/vrfs/" + $vrf
}
Expand Down

0 comments on commit eb867c2

Please sign in to comment.