-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial windows packer templates for ami (#155)
* Add initial windows packer templates for ami Signed-off-by: Peter Zhu <[email protected]> * Tweak readme Signed-off-by: Peter Zhu <[email protected]> * Make changes based on the PR comments Signed-off-by: Peter Zhu <[email protected]> * Disable windows internal firewall and allow Security Group to take care of ports Signed-off-by: Peter Zhu <[email protected]> * Change templates to use gp3 as default ebs Signed-off-by: Peter Zhu <[email protected]>
1 parent
75b5ce9
commit 25e235e
Showing
13 changed files
with
511 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Packer Templates for Creating EC2 AMI | ||
|
||
### Structure | ||
|
||
* **config:** This folder contains all the configuration files. | ||
* **scripts:** This folder contains all the running scripts during the image creation. | ||
* **.json:** All templates are now in JSON format, we have not converted them into HCL2 yet. | ||
|
||
### Templates | ||
* jenkins-agent-win2016-x64.json: Windows 2016 Server. | ||
* jenkins-agent-win2019-x64.json: Windows 2019 Server (Recommended). | ||
* jenkins-agent-win2019-x64-alpine-wsl.json: Windows 2019 Server with WSL enabled running Alpine 3. | ||
|
||
### Usages | ||
|
||
* You need to install `packer` on your host as a pre-requisite. | ||
``` | ||
# Needs to be run in this directory | ||
$ cd packer/ | ||
# Run build AMI: | ||
$ packer build <template json name> | ||
# Run build AMI with debug mode: | ||
$ packer build -debug <template json name> | ||
``` | ||
|
||
### Notes | ||
|
||
* Run packer outside of VPN as port 5985/5986, 22, 445 might be blocked for winrm/ssh/smb during the provision, corresponding security group must have the same rules. | ||
* Make sure the variable section in the template file is filled up, as well as the configs in config folder. | ||
* Must use a public subnet for packer to connect to the hosts. | ||
* You can choose to use fixed AMI ID instead of using the AMI filter to find the IDs. | ||
* EC2Launch vs EC2Launchv2 have a lot of differences, all the templates here are using EC2Launch on Windows AMI. | ||
* If the process get interrupted in the middle of the run, you need to log onto AWS console to cleanup everything starts with `packer` prefix. | ||
|
||
### Thanks | ||
|
||
* The Windows templates here are based on the original work by [Ross Derewianko](https://github.com/rderewianko). Thanks for his contribution and post to make it work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"setComputerName": false, | ||
"setWallpaper": true, | ||
"addDnsSuffixList": true, | ||
"extendBootVolumeSize": true, | ||
"adminPasswordType": "Specify", | ||
"adminPassword": "EnterYourPassWordMustMatchAwsPasswordRequirements" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"variables":{ | ||
"name-base":"Jenkins-Agent-Windows2016", | ||
"build-region":"us-east-1", | ||
"build-vpc":"vpc-<>", | ||
"build-subnet":"subnet-<>", | ||
"build-secgrp":"sg-<>", | ||
"build-time":"{{isotime \"2006-01-02T03-04-05Z\"}}", | ||
"aws_ami_region":"us-east-1" | ||
}, | ||
"builders":[ | ||
{ | ||
"name":"{{user `name-base`}}-{{user `build-time`}}" , | ||
"ami_description":"{{user `name-base`}}", | ||
"type":"amazon-ebs", | ||
"encrypt_boot":"false", | ||
"region":"{{user `build-region`}}", | ||
"ami_regions":"{{user `aws_ami_region`}}", | ||
"instance_type":"c5.4xlarge", | ||
"ami_name":"{{user `name-base`}}-{{user `build-time`}}", | ||
"vpc_id":"{{user `build-vpc`}}", | ||
"subnet_id":"{{user `build-subnet`}}", | ||
"security_group_ids":"{{user `build-secgrp`}}", | ||
"source_ami_filter":{ | ||
"filters":{ | ||
"virtualization-type":"hvm", | ||
"architecture":"x86_64", | ||
"name": "Windows_Server-2016-English-Full-Base-20*", | ||
"block-device-mapping.volume-type":"gp2", | ||
"root-device-type":"ebs" | ||
}, | ||
"owners":[ | ||
"amazon" | ||
], | ||
"most_recent":true | ||
}, | ||
"user_data_file":"scripts/windows/userdata.ps1", | ||
"associate_public_ip_address":false, | ||
"communicator":"winrm", | ||
"winrm_username":"Administrator", | ||
"winrm_timeout":"40m", | ||
"windows_password_timeout":"30m", | ||
"winrm_insecure":true, | ||
"tags":{ | ||
"Name": "{{user `name-base`}}-{{user `build-time`}}", | ||
"OS_Version":"{{user `name-base`}}", | ||
"User":"Packer", | ||
"Encrypted_AMI":"False", | ||
"Created":"{{user `build-time`}}" | ||
}, | ||
"launch_block_device_mappings":[ | ||
{ | ||
"device_name":"/dev/sda1", | ||
"volume_size":100, | ||
"delete_on_termination":true, | ||
"volume_type":"gp3" | ||
} | ||
] | ||
} | ||
], | ||
"provisioners":[ | ||
{ | ||
"type":"powershell", | ||
"scripts": [ | ||
"scripts/windows/smb-setup.ps1", | ||
"scripts/windows/scoop-setup.ps1", | ||
"scripts/windows/scoop-install-commons.ps1", | ||
"scripts/windows/pip-install.ps1" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type":"file", | ||
"source":"config/windows/launch-config.json", | ||
"destination":"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json" | ||
}, | ||
{ | ||
"type":"powershell", | ||
"inline":"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule" | ||
}, | ||
{ | ||
"type":"powershell", | ||
"inline":"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"variables": { | ||
"name-base":"Jenkins-Agent-Windows2019", | ||
"build-region":"us-east-1", | ||
"build-vpc":"vpc-<>", | ||
"build-subnet":"subnet-<>", | ||
"build-secgrp":"sg-<>", | ||
"build-time":"{{isotime \"2006-01-02T03-04-05Z\"}}", | ||
"aws_ami_region":"us-east-1" | ||
}, | ||
"builders": [ | ||
{ | ||
"name":"{{user `name-base`}}-{{user `build-time`}}" , | ||
"ami_description":"{{user `name-base`}}", | ||
"type":"amazon-ebs", | ||
"encrypt_boot":"false", | ||
"region":"{{user `build-region`}}", | ||
"ami_regions":"{{user `aws_ami_region`}}", | ||
"instance_type":"c5.4xlarge", | ||
"ami_name":"{{user `name-base`}}-{{user `build-time`}}", | ||
"vpc_id":"{{user `build-vpc`}}", | ||
"subnet_id":"{{user `build-subnet`}}", | ||
"security_group_ids":"{{user `build-secgrp`}}", | ||
"source_ami_filter": { | ||
"filters": { | ||
"virtualization-type":"hvm", | ||
"architecture":"x86_64", | ||
"name": "Windows_Server-2019-English-Full-Base-20*", | ||
"block-device-mapping.volume-type":"gp2", | ||
"root-device-type":"ebs" | ||
}, | ||
"owners": [ | ||
"amazon" | ||
], | ||
"most_recent":true | ||
}, | ||
"user_data_file":"scripts/windows/userdata.ps1", | ||
"associate_public_ip_address":false, | ||
"communicator":"winrm", | ||
"winrm_username":"Administrator", | ||
"winrm_timeout":"40m", | ||
"windows_password_timeout":"30m", | ||
"winrm_insecure":true, | ||
"tags": { | ||
"Name": "{{user `name-base`}}-{{user `build-time`}}", | ||
"OS_Version":"{{user `name-base`}}", | ||
"User":"Packer", | ||
"Encrypted_AMI":"False", | ||
"Created":"{{user `build-time`}}" | ||
}, | ||
"launch_block_device_mappings": [ | ||
{ | ||
"device_name":"/dev/sda1", | ||
"volume_size":100, | ||
"delete_on_termination":true, | ||
"volume_type":"gp3" | ||
} | ||
] | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type":"powershell", | ||
"scripts": [ | ||
"scripts/windows/smb-setup-2019-plus.ps1", | ||
"scripts/windows/scoop-setup.ps1", | ||
"scripts/windows/scoop-install-commons.ps1", | ||
"scripts/windows/pip-install.ps1", | ||
"scripts/windows/wsl-setup.ps1" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type":"file", | ||
"source":"config/windows/launch-config.json", | ||
"destination":"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json" | ||
}, | ||
{ | ||
"type": "windows-restart" | ||
}, | ||
{ | ||
"type":"powershell", | ||
"scripts": [ | ||
"scripts/windows/scoop-install-alpinewsl.ps1" | ||
] | ||
}, | ||
{ | ||
"type":"powershell", | ||
"inline": [ | ||
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule", | ||
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1 -NoShutdown" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"variables": { | ||
"name-base":"Jenkins-Agent-Windows2019", | ||
"build-region":"us-east-1", | ||
"build-vpc":"vpc-<>", | ||
"build-subnet":"subnet-<>", | ||
"build-secgrp":"sg-<>", | ||
"build-time":"{{isotime \"2006-01-02T03-04-05Z\"}}", | ||
"aws_ami_region":"us-east-1" | ||
}, | ||
"builders": [ | ||
{ | ||
"name":"{{user `name-base`}}-{{user `build-time`}}" , | ||
"ami_description":"{{user `name-base`}}", | ||
"type":"amazon-ebs", | ||
"encrypt_boot":"false", | ||
"region":"{{user `build-region`}}", | ||
"ami_regions":"{{user `aws_ami_region`}}", | ||
"instance_type":"c5.4xlarge", | ||
"ami_name":"{{user `name-base`}}-{{user `build-time`}}", | ||
"vpc_id":"{{user `build-vpc`}}", | ||
"subnet_id":"{{user `build-subnet`}}", | ||
"security_group_ids":"{{user `build-secgrp`}}", | ||
"source_ami_filter": { | ||
"filters": { | ||
"virtualization-type":"hvm", | ||
"architecture":"x86_64", | ||
"name": "Windows_Server-2019-English-Full-Base-20*", | ||
"block-device-mapping.volume-type":"gp2", | ||
"root-device-type":"ebs" | ||
}, | ||
"owners": [ | ||
"amazon" | ||
], | ||
"most_recent":true | ||
}, | ||
"user_data_file":"scripts/windows/userdata.ps1", | ||
"associate_public_ip_address":false, | ||
"communicator":"winrm", | ||
"winrm_username":"Administrator", | ||
"winrm_timeout":"40m", | ||
"windows_password_timeout":"30m", | ||
"winrm_insecure":true, | ||
"tags": { | ||
"Name": "{{user `name-base`}}-{{user `build-time`}}", | ||
"OS_Version":"{{user `name-base`}}", | ||
"User":"Packer", | ||
"Encrypted_AMI":"False", | ||
"Created":"{{user `build-time`}}" | ||
}, | ||
"launch_block_device_mappings": [ | ||
{ | ||
"device_name":"/dev/sda1", | ||
"volume_size":100, | ||
"delete_on_termination":true, | ||
"volume_type":"gp3" | ||
} | ||
] | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type":"powershell", | ||
"scripts": [ | ||
"scripts/windows/smb-setup-2019-plus.ps1", | ||
"scripts/windows/scoop-setup.ps1", | ||
"scripts/windows/scoop-install-commons.ps1", | ||
"scripts/windows/pip-install.ps1" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type":"file", | ||
"source":"config/windows/launch-config.json", | ||
"destination":"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Config\\LaunchConfig.json" | ||
}, | ||
{ | ||
"type": "windows-restart" | ||
}, | ||
{ | ||
"type":"powershell", | ||
"inline": [ | ||
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\InitializeInstance.ps1 -Schedule", | ||
"C:\\ProgramData\\Amazon\\EC2-Windows\\Launch\\Scripts\\SysprepInstance.ps1 -NoShutdown" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# This needs to be repeated more than twice (sometimes) to actually install packages without --user | ||
# After applying the install-pep-514.reg from scoop for Python specifically | ||
|
||
# Need TLS12 in order to install pip correctly | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
wget https://bootstrap.pypa.io/get-pip.py -OutFile get-pip.py | ||
python get-pip.py | ||
pip --version | ||
|
||
# Install pipenv | ||
pip install pipenv | ||
pipenv --version | ||
|
||
# Install awscli | ||
pip install awscli | ||
aws --version | ||
|
||
# Cleanup | ||
Remove-Item 'get-pip.py' -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Disable "current" alias directory as it is not preserved after AMI creation | ||
# Use static path in environment variable | ||
scoop config NO_JUNCTIONS true | ||
|
||
# Install alpine | ||
scoop bucket add extras | ||
scoop install alpinewsl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Disable "current" alias directory as it is not preserved after AMI creation | ||
# Use static path in environment variable | ||
scoop config NO_JUNCTIONS true | ||
|
||
# Install git | ||
scoop install git | ||
git --version | ||
# Path for git windows usr bin | ||
$fileName = 'nohup.exe' | ||
$fileDir = 'C:\\Users\\Administrator\\scoop\\apps\\git' | ||
$fileFound = (Get-ChildItem -Path $fileDir -Filter $fileName -Recurse | %{$_.FullName} | select -first 1) | ||
$fileFound | ||
$gitPathFound = $fileFound.replace('nohup.exe', '') | ||
$gitPathFound | ||
# Add to EnvVar | ||
$userenv = [System.Environment]::GetEnvironmentVariable("Path", "User") | ||
[System.Environment]::SetEnvironmentVariable("PATH", $userenv + ";$gitPathFound", "User") | ||
|
||
# Setup Repos (This has to happen after git is installed or will error out) | ||
scoop bucket add java | ||
scoop bucket add versions | ||
|
||
# Install jdk8 | ||
scoop install temurin8-jdk | ||
java -version | ||
|
||
# Install python37 | ||
scoop install python37 | ||
python --version | ||
# Reg PEP | ||
$versionInfo = (scoop info python37 | out-string -stream | Select-String 'Version.*:') | ||
$versionNumber = ($versionInfo -split ':' | select -last 1) | ||
$versionNumber = $versionNumber.Trim() | ||
$pythonHome = "C:\\Users\\Administrator\\scoop\\apps\\python37\\$versionNumber" | ||
$pythonLibHome = "$pythonHome\\Lib" | ||
$regFilePath = "$pythonHome\\install-pep-514.reg" | ||
$regFilePath | ||
regedit /s $regFilePath | ||
# Windows AMI does not preserve alias directory, copy all the files to an actual directory | ||
New-Item -Path "$pythonHome\\Scripts_temp" -ItemType Directory | ||
Copy-Item -Path "$pythonHome\\Scripts\\*" -Destination "$pythonHome\\Scripts_temp\\" | ||
Remove-Item "$pythonHome\\Scripts" -Force -Recurse | ||
Rename-Item "$pythonHome\\Scripts_temp" "$pythonHome\\Scripts" | ||
# Same as above but different dir | ||
New-Item -Path "$pythonLibHome\\site-packages_temp" -ItemType Directory | ||
Copy-Item -Path "$pythonLibHome\\site-packages\\*" -Destination "$pythonLibHome\\site-packages_temp\\" | ||
Remove-Item "$pythonLibHome\\site-packages" -Force -Recurse | ||
Rename-Item "$pythonLibHome\\site-packages_temp" "$pythonLibHome\\site-packages" | ||
|
||
# Install maven | ||
scoop install maven | ||
mvn --version | ||
|
||
# Install nvm (the last in order is default as nvm-win does not allow nvm alias/use default <version>) | ||
scoop install nvm | ||
nvm install 10.24.1 | ||
nvm use 10.24.1 | ||
npm install -g yarn | ||
nvm install 14.19.1 | ||
nvm use 14.19.1 | ||
npm install -g yarn | ||
|
||
# Install ruby24 | ||
scoop install ruby24 | ||
ruby --version | ||
|
||
# Install jq | ||
scoop install jq | ||
jq --version | ||
|
||
# Install yq | ||
scoop install yq | ||
yq --version | ||
|
||
# Install dev tools | ||
scoop install cmake | ||
cmake --version | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Set TLS to 1.2 so SSL/TLS can be enabled for downloading artifacts | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
|
||
# Install Scoop as Administrator User here | ||
iex "& {$(irm get.scoop.sh)} -RunAsAdmin" | ||
|
||
# Disable "current" alias directory as it is not preserved after AMI creation | ||
# Use static path in environment variable | ||
scoop config NO_JUNCTIONS true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Windows Enable SMB1 | ||
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart | ||
|
||
# Windows7, Windows2008, WindowsVista | ||
set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters SMB1 -Type DWORD -Value 1 -Force | ||
Restart-Service lanmanserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Windows Enable SMB1 | ||
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol -NoRestart | ||
|
||
# Windows 2016 Setups | ||
Set-SmbServerConfiguration -EnableSMB1Protocol $true -Confirm:$true -Force | ||
|
||
# Windows7, Windows2008, WindowsVista | ||
set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters SMB1 -Type DWORD -Value 1 -Force | ||
Restart-Service lanmanserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<powershell> | ||
|
||
############################## With HTTP ###################################### | ||
## Setup winrm | ||
cmd /c winrm quickconfig -q | ||
cmd /c winrm quickconfig '-transport:http' | ||
cmd /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}' | ||
cmd /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="1024"}' | ||
cmd /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}' | ||
cmd /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}' | ||
cmd /c winrm set "winrm/config/service/auth" '@{Basic="true"}' | ||
cmd /c winrm set "winrm/config/client/auth" '@{Basic="true"}' | ||
cmd /c winrm set "winrm/config/listener?Address=*+Transport=HTTP" '@{Port="5985"}' | ||
cmd /c netsh advfirewall set allprofiles state off | ||
cmd /c net stop winrm | ||
cmd /c sc config winrm start= auto | ||
cmd /c net start winrm | ||
|
||
echo "Create Jenkins Home" | ||
New-Item -Path 'C:\\Users\\Administrator\\jenkins' -ItemType Directory | ||
|
||
</powershell> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# Enable WSL1 | ||
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart |