-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add TACACS Server configuration (Add/Get/Set/Remove) #46
base: master
Are you sure you want to change the base?
Conversation
PowerArubaCX/Public/Tacacs.ps1
Outdated
|
||
<# | ||
.SYNOPSIS | ||
Add Aruba CX Tacacs Server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int64 ? (for validateRange)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All example with Pipeline ?
|
||
$_group = @() | ||
|
||
$_group += "/rest/" + $($connection.version) + "/system/aaa_server_groups/" + $group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
always needed to be update ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this write-progress too
Tests/integration/Tacacs.Tests.ps1
Outdated
. ../common.ps1 | ||
|
||
Describe "Get TACACS Server" { | ||
BeforeALL { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-be -> -Be (same issue after)
[Parameter(Mandatory = $false)] | ||
[ValidateRange(1, 4)] | ||
[Int]$depth, | ||
[Parameter(Mandatory = $false, ParameterSetName = "address")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why parameter set ?
[Parameter (Mandatory = $true, ParameterSetName = "address")] | ||
[ipaddress]$address, | ||
[Parameter (Mandatory = $false)] | ||
[int]$port = 49, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing parameter set name for port ?
[CmdletBinding(DefaultParametersetname = "Default")] | ||
Param( | ||
[Parameter (Mandatory = $true, ParameterSetName = "address")] | ||
[ipaddress]$address, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TACACS can't be a FQDN ?
|
||
$uri = "system/vrfs/${vrf}/tacacs_servers/${address},${port}" | ||
|
||
if ($PSCmdlet.ShouldProcess("Tacacs Server (VRF: ${vrf})", "Remove ${address},${port}")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TACACS Server
Get-ArubaCXTacacsServer -address 192.2.0.1 | Remove-ArubaCXTacacsServer | ||
``` | ||
|
||
For configure a vlan to an interface, need to use [Set-ArubaCXInterfaces](#Interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to fix some stuff before merge
} | ||
} | ||
|
||
$response = Invoke-ArubaCXRestMethod -uri $uri -method 'POST' -body $_tacacs -connection $connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove $response
|
||
|
||
# Remove a TACACS Server | ||
Get-ArubaCXTacacsServer -address 192.2.0.1 | Remove-ArubaCXTacacsServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add example of remove...
@@ -13,6 +13,8 @@ $script:pester_interface2 = "1/1/2" #interface id for test... | |||
$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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is 192.0.2.0/24 for example network
@@ -0,0 +1,227 @@ | |||
# | |||
# Copyright 2020, Cédric Moreau <moreaucedric0 at gmail dot com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copyright :D
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add search without port
and also with position = 1
No description provided.