Add TACACS Server configuration (Add/Get/Set/Remove)#46
Add TACACS Server configuration (Add/Get/Set/Remove)#46CedricMoreau wants to merge 7 commits intoPowerAruba:masterfrom
Conversation
PowerArubaCX/Public/Tacacs.ps1
Outdated
|
|
||
| <# | ||
| .SYNOPSIS | ||
| Add Aruba CX Tacacs Server |
There was a problem hiding this comment.
Tacacs => TACACS (for other after too)
PowerArubaCX/Public/Tacacs.ps1
Outdated
| [string]$auth_type = "pap", | ||
| [Parameter (Mandatory = $true)] | ||
| [ValidateRange(1, 9223372036854775807)] | ||
| [int]$default_group_priority, |
There was a problem hiding this comment.
int64 ? (for validateRange)
alagoutte
left a comment
There was a problem hiding this comment.
Can you also update README(.md) add on list of supported feature/commands and add also some example...
PowerArubaCX/Public/Tacacs.ps1
Outdated
| Configure TACACS Server (Timeout, port...) | ||
|
|
||
| .EXAMPLE | ||
| Set-ArubaCXTacacsServer -timeout 15 -address 192.2.0.1 -port 49 |
There was a problem hiding this comment.
All example with Pipeline ?
|
|
||
| $_group = @() | ||
|
|
||
| $_group += "/rest/" + $($connection.version) + "/system/aaa_server_groups/" + $group |
There was a problem hiding this comment.
always needed to be update ?
PowerArubaCX/Public/Tacacs.ps1
Outdated
|
|
||
| if ($PSCmdlet.ShouldProcess("Tacacs Server (VRF: ${vrf})", "Remove ${address},${port}")) { | ||
| Invoke-ArubaCXRestMethod -method "DELETE" -uri $uri -connection $connection | ||
| Write-Progress -activity "Remove Tacacs Server" -completed |
There was a problem hiding this comment.
remove this write-progress too
Tests/integration/Tacacs.Tests.ps1
Outdated
| . ../common.ps1 | ||
|
|
||
| Describe "Get TACACS Server" { | ||
| BeforeALL { |
Tests/integration/Tacacs.Tests.ps1
Outdated
|
|
||
| It "Get TACACS Server with one attribute (auth_type)" { | ||
| $tacacs = Get-ArubaCXTacacsServer -address $pester_tacacs_address -port $pester_tacacs_port -attribute auth_type | ||
| @($tacacs).count | Should -be 1 |
There was a problem hiding this comment.
-be -> -Be (same issue after)
| [Parameter(Mandatory = $false)] | ||
| [ValidateRange(1, 4)] | ||
| [Int]$depth, | ||
| [Parameter(Mandatory = $false, ParameterSetName = "address")] |
| [Parameter (Mandatory = $true, ParameterSetName = "address")] | ||
| [ipaddress]$address, | ||
| [Parameter (Mandatory = $false)] | ||
| [int]$port = 49, |
There was a problem hiding this comment.
missing parameter set name for port ?
| [CmdletBinding(DefaultParametersetname = "Default")] | ||
| Param( | ||
| [Parameter (Mandatory = $true, ParameterSetName = "address")] | ||
| [ipaddress]$address, |
There was a problem hiding this comment.
TACACS can't be a FQDN ?
|
|
||
| $uri = "system/vrfs/${vrf}/tacacs_servers/${address},${port}" | ||
|
|
||
| if ($PSCmdlet.ShouldProcess("Tacacs Server (VRF: ${vrf})", "Remove ${address},${port}")) { |
| Get-ArubaCXTacacsServer -address 192.2.0.1 | Remove-ArubaCXTacacsServer | ||
| ``` | ||
|
|
||
| For configure a vlan to an interface, need to use [Set-ArubaCXInterfaces](#Interface) |
alagoutte
left a comment
There was a problem hiding this comment.
Need to fix some stuff before merge
| } | ||
| } | ||
|
|
||
| $response = Invoke-ArubaCXRestMethod -uri $uri -method 'POST' -body $_tacacs -connection $connection |
|
|
||
|
|
||
| # Remove a TACACS Server | ||
| Get-ArubaCXTacacsServer -address 192.2.0.1 | Remove-ArubaCXTacacsServer |
There was a problem hiding this comment.
add example of remove...
| $script:pester_lag = "2" #lag id for test... | ||
| $script:pester_loopback = "2" #loopback id for test... | ||
| $script:pester_vrf = "pester_vrf" #interface id for test... | ||
| $script:pester_tacacs_address = "192.2.0.1" |
There was a problem hiding this comment.
it is 192.0.2.0/24 for example network
| @@ -0,0 +1,227 @@ | |||
| # | |||
| # Copyright 2020, Cédric Moreau <moreaucedric0 at gmail dot com> | |||
|
|
||
| Context "Search" { | ||
| It "Search TACACS Server by address ($pester_tacacs_address)" { | ||
| $tacacs = Get-ArubaCXTacacsServer -address $pester_tacacs_address -port $pester_tacacs_port |
There was a problem hiding this comment.
add search without port
and also with position = 1
|
any update @CedricMoreau ? :) |
No description provided.