From f580733fa8471f55c501178ec9702415d7be14f0 Mon Sep 17 00:00:00 2001 From: Jared Burns Date: Fri, 3 Nov 2023 10:32:10 -0400 Subject: [PATCH] docs: add air-gapped install (#393) Added documentation to install module and dependencies in a air-gapped environment. Signed-off-by: Jared Burns --- docs/install.md | 52 +++++++++++++++++++++ docs/snippets/copy-module-local-linux.sh | 1 + docs/snippets/copy-module-local-windows.ps1 | 1 + docs/snippets/import-module-local-linux.ps1 | 5 ++ docs/snippets/pre-req-linux.sh | 1 + docs/snippets/save-module-local-linux.ps1 | 5 ++ docs/snippets/save-module-local-windows.ps1 | 5 ++ 7 files changed, 70 insertions(+) create mode 100644 docs/snippets/copy-module-local-linux.sh create mode 100644 docs/snippets/copy-module-local-windows.ps1 create mode 100644 docs/snippets/import-module-local-linux.ps1 create mode 100644 docs/snippets/pre-req-linux.sh create mode 100644 docs/snippets/save-module-local-linux.ps1 create mode 100644 docs/snippets/save-module-local-windows.ps1 diff --git a/docs/install.md b/docs/install.md index 06567052..26e47d4c 100644 --- a/docs/install.md +++ b/docs/install.md @@ -1,5 +1,7 @@ # Installing the Module +## From Powershell Gallery + Verify that your system has a [supported edition and version](/power-validated-solutions-for-cloud-foundation/#powershell) of PowerShell installed. Install the PowerShell [module dependencies](/power-validated-solutions-for-cloud-foundation/#module-dependencies) from the PowerShell Gallery by running the following commands: @@ -16,6 +18,56 @@ For example: --8<-- "./docs/snippets/import-module.ps1" ``` +## From Air-gapped Machine + +Verify that your system has a [supported edition and version](/powershell-module-for-vmware-cloud-foundation-password-management/#powershell) of PowerShell installed. + +=== ":fontawesome-brands-windows:   Windows" + + Save Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the PowerShell Gallery on a non air-gapped machine by running the following commands: + + ```powershell + --8<-- "./docs/snippets/save-module-local-windows.ps1" + ``` + + Copy the PowerShell Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the Local Machine to air-gapped facing machine by running the following commands: + + ```powershell + --8<-- "./docs/snippets/copy-module-local-windows.ps1" + ``` + + Import the PowerShell Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the air-gapped machine by running the following commands: + + ```powershell + --8<-- "./docs/snippets/import-module.ps1" + ``` + +=== ":fontawesome-brands-linux:   Linux" + + Prerequisite for module install on Linux Machine + + ```bash + --8<-- "./docs/snippets/pre-req-linux.sh" + ``` + + Save Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the PowerShell Gallery on a non air-gapped machine by running the following commands: + + ```powershell + --8<-- "./docs/snippets/save-module-local-linux.ps1" + ``` + + Copy the PowerShell Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the Local Machine to air-gapped facing machine by running the following commands: + + ```bash + --8<-- "./docs/snippets/copy-module-local-linux.sh" + ``` + + Import the PowerShell Modules [module dependencies](/powershell-module-for-vmware-cloud-foundation-password-management/#module-dependencies) from the air-gapped machine by running the following commands in PowerShell: + + ```powershell + --8<-- "./docs/snippets/import-module-local-linux.ps1" + ``` + To verify the correct versions of the supporting modules are installed, run the following command in the PowerShell console. ```powershell diff --git a/docs/snippets/copy-module-local-linux.sh b/docs/snippets/copy-module-local-linux.sh new file mode 100644 index 00000000..de4e7d09 --- /dev/null +++ b/docs/snippets/copy-module-local-linux.sh @@ -0,0 +1 @@ +scp -r /home/modules/* username@remote_host:/home/lab/.local/share/powershell/Modules/ \ No newline at end of file diff --git a/docs/snippets/copy-module-local-windows.ps1 b/docs/snippets/copy-module-local-windows.ps1 new file mode 100644 index 00000000..598c97e5 --- /dev/null +++ b/docs/snippets/copy-module-local-windows.ps1 @@ -0,0 +1 @@ +Copy-Item -Path F:\Module\* -Destination '\\\C$\Program Files\WindowsPowerShell\Modules\' -Recurse \ No newline at end of file diff --git a/docs/snippets/import-module-local-linux.ps1 b/docs/snippets/import-module-local-linux.ps1 new file mode 100644 index 00000000..33fa6afb --- /dev/null +++ b/docs/snippets/import-module-local-linux.ps1 @@ -0,0 +1,5 @@ +Import-Module -Name VMware.PowerCLI +Import-Module -Name VMware.vSphere.SsoAdmin +Import-Module -Name PowerVCF +Import-Module -Name PowerValidatedSolutions +Import-Module -Name ImportExcel \ No newline at end of file diff --git a/docs/snippets/pre-req-linux.sh b/docs/snippets/pre-req-linux.sh new file mode 100644 index 00000000..f305e4f9 --- /dev/null +++ b/docs/snippets/pre-req-linux.sh @@ -0,0 +1 @@ +mkdir /home/modules \ No newline at end of file diff --git a/docs/snippets/save-module-local-linux.ps1 b/docs/snippets/save-module-local-linux.ps1 new file mode 100644 index 00000000..9290c030 --- /dev/null +++ b/docs/snippets/save-module-local-linux.ps1 @@ -0,0 +1,5 @@ +Save-Module -Name VMware.PowerCLI -Path /home/modules +Save-Module -Name VMware.vSphere.SsoAdmin -Path /home/modules +Save-Module -Name PowerVCF -Path /home/modules +Save-Module -Name PowerValidatedSolutions -Path /home/modules +Save-Module -Name ImportExcel -Path /home/modules \ No newline at end of file diff --git a/docs/snippets/save-module-local-windows.ps1 b/docs/snippets/save-module-local-windows.ps1 new file mode 100644 index 00000000..f3f75504 --- /dev/null +++ b/docs/snippets/save-module-local-windows.ps1 @@ -0,0 +1,5 @@ +Import-Module -Name VMware.PowerCLI -Path F:\Module\ +Import-Module -Name VMware.vSphere.SsoAdmin -Path F:\Module\ +Import-Module -Name PowerVCF -Path F:\Module\ +Import-Module -Name PowerValidatedSolutions -Path F:\Module\ +Import-Module -Name ImportExcel -Path F:\Module\ \ No newline at end of file