Skip to content

Commit

Permalink
feat: global manager cert replacement (#762)
Browse files Browse the repository at this point in the history
- Updated `Invoke-NsxFederationDeployment` cmdlet to include `Install-NsxtGlobalManagerCertificate` cmdlet.
- Added Documentation

Signed-off-by: Gary Blake <gblake@vmware.com>
  • Loading branch information
GaryJBlake authored Sep 18, 2024
1 parent 34b562f commit da04eac
Show file tree
Hide file tree
Showing 9 changed files with 634 additions and 218 deletions.
2 changes: 1 addition & 1 deletion PowerValidatedSolutions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'PowerValidatedSolutions.psm1'

# Version number of this module.
ModuleVersion = '2.12.0.1034'
ModuleVersion = '2.12.0.1035'

# ID used to uniquely identify this module
GUID = 'a6dfed7b-65d2-4da2-bdcc-7f3d3df9b75d'
Expand Down
436 changes: 219 additions & 217 deletions PowerValidatedSolutions.psm1

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Add-NsxtGlobalManagerCertificate

## Synopsis

Install a certificate in the NSX Global Manager.

## Syntax

```powershell
Add-NsxtGlobalManagerCertificate [-old_certificate_id] <String> [-new_certificate_id] <String> [<CommonParameters>]
```

## Description

The `Add-NsxtGlobalManagerCertificate` cmdlet installs a certificate in the NSX Global Manager.

## Examples

### Example 1

```powershell
Add-NsxtGlobalManagerCertificate -old_certificate_id 7f3561c7-4630-42fb-ae1e-54abe0945254 -new_certificate_id f64fe940-9569-4621-940f-90ea2adafd93
```

This example installs a certificate in the NSX Global Manager.

## Parameters

### -old_certificate_id

The ID of the old certificate.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -new_certificate_id
The ID of the new certificate.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### Common Parameters
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Get-NsxtGlobalManagerCertificate

## Synopsis

Retrieve the list of certificates from the NSX Global Manager.

## Syntax

```powershell
Get-NsxtGlobalManagerCertificate [[-certificateId] <String>] [<CommonParameters>]
```

## Description

The `Get-NsxtGlobalManagerCertificate` cmdlet retrieves the list of certificates from the NSX Global Manager.

## Examples

### Example 1

```powershell
Get-NsxtGlobalManagerCertificate
```

This example retrieves the list of certificates from the NSX Global Manager.

### Example 2

```powershell
Get-NsxtGlobalManagerCertificate -certificateId f64fe940-9569-4621-940f-90ea2adafd93
```

This example retrieves a certificate from the NSX Global Manager.

## Parameters

### -certificateId

The ID of the certificate in the NSX Global Manager.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### Common Parameters
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Get-NsxtGlobalManagerCertificateResult

## Synopsis

Retrieve the status of applied certificate from the NSX Global Manager.

## Syntax

```powershell
Get-NsxtGlobalManagerCertificateResult
```

## Description

The `Get-NsxtGlobalManagerCertificateResult` cmdlet retrieves the status of the applied certificate from the NSX Global Manager.

## Examples

### Example 1

```powershell
Get-NsxtGlobalManagerCertificateResult
```

This example retrieves the status of the applied certificate from the NSX Global Manager.
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Import-NsxtGlobalManagerCertificate

## Synopsis

Import a certificate to the NSX Global Manager.

## Syntax

```powershell
Import-NsxtGlobalManagerCertificate [-certificateAlias] <String> [-certChainPath] <String> [[-certificatePassphrase] <String>] [<CommonParameters>]
```

## Description

The `Import-NsxtGlobalManagerCertificate` cmdlet imports a certificate to the the NSX Global Manager.

## Examples

### Example 1

```powershell
Import-NsxtGlobalManagerCertificate -certificateAlias sfo-m01-nsx-gm01-cert -certChainPath ".\certificates\sfo-m01-nsx-gm01.sfo.rainpole.io.pem" -certificatePassphrase "VMw@re1!"
```

This example imports a certificate to the the NSX Global Manager.

## Parameters

### -certificateAlias

The alias of the certificate to add to the NSX Global Manager.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -certChainPath
The path to the certificate chain file to add to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -certificatePassphrase
The passphrase of the certificate to add to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### Common Parameters
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Install-NsxtGlobalManagerCertificate

## Synopsis

Install a certificate for the NSX Global Manager.

## Syntax

```powershell
Install-NsxtGlobalManagerCertificate [-server] <String> [-user] <String> [-pass] <String> [-certificateName] <String> [-certFile] <String> [[-certificatePassphrase] <String>] [<CommonParameters>]
```

## Description

The `Install-NsxtGlobalManagerCertificate` cmdlet installs a certificate for the NSX Global Manager.

- Validates that network connectivity and authentication are possible to NSX Global Manager.
- Validates that the given certificate file and certificate name.
- Installs the certificate for the NSX Global Manager.

## Examples

### Example 1

```powershell
Install-NsxtGlobalManagerCertificate -server lax-m01-nsx-gm01.lax.rainpole.io -user admin -pass VMw@re1!VMw@re1! -certificateName "lax-m0123" -certFile .\certificates\lax-m01-nsx-gm01.lax.rainpole.io.pem
```

This example installs a certificate for the NSX Global Manager.

### Example 2

```powershell
Install-NsxtGlobalManagerCertificate -server lax-m01-nsx-gm01.lax.rainpole.io -user admin -pass VMw@re1!VMw@re1! -certificateName "lax-m0123" -certFile .\certificates\lax-m01-nsx-gm01.lax.rainpole.io.pem -certificatePassphrase "VMw@re1!"
```

This example installs a certificate for the NSX Global Manager.

## Parameters

### -server

The fully qualified domain name of the NSX Global Manager.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -user
The username to authenticate to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -pass
The password to authenticate to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -certificateName
The name of the certificate to add to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -certFile
The path to the certificate file to add to tthe NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -certificatePassphrase
The passphrase of the certificate to add to the NSX Global Manager.
```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### Common Parameters
This cmdlet supports the common parameters: `-Debug`, `-ErrorAction`, `-ErrorVariable`, `-InformationAction`, `-InformationVariable`, `-OutVariable`, `-OutBuffer`, `-PipelineVariable`, `-Verbose`, `-WarningAction`, and `-WarningVariable`. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Loading

0 comments on commit da04eac

Please sign in to comment.