Last active
April 30, 2019 13:21
-
-
Save ruzickap/865040f76694948d71e0d00a0eecaa88 to your computer and use it in GitHub Desktop.
Create Packer template and Autounattended file for Windows Server 2016 Eval + download few helper scrips
This file contains hidden or 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
# Prepare directory structure | |
mkdir -p /var/tmp/packer_windows-server-2016-eval/{scripts/win-common,http/windows-server-2016,ansible} | |
cd /var/tmp/packer_windows-server-2016-eval | |
# Download Autounattended file for Windows Server 2016 Evaluation | |
wget -c -P http/windows-server-2016 https://raw.githubusercontent.com/ruzickap/packer-templates/master/http/windows-server-2016/Autounattend.xml | |
# Create some basic Ansible playbook for Windows provisioning | |
cat > ansible/win.yml << EOF | |
--- | |
- hosts: all | |
tasks: | |
- name: Enable Remote Desktop | |
win_regedit: | |
key: 'HKLM:\System\CurrentControlSet\Control\Terminal Server' | |
value: fDenyTSConnections | |
data: 0 | |
datatype: dword | |
- name: Allow connections from computers running any version of Remote Desktop (less secure) | |
win_regedit: | |
key: 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' | |
value: UserAuthentication | |
data: 0 | |
datatype: dword | |
- name: Allow RDP traffic | |
win_shell: Enable-NetFirewallRule -DisplayGroup "Remote Desktop" | |
EOF | |
# Get scripts which helps during Autounattended installation + executed after Ansible | |
wget -c -P scripts/win-common https://raw.githubusercontent.com/ruzickap/packer-templates/master/scripts/win-common/{fixnetwork.ps1,remove_nic.bat} | |
# Get the Packer template | |
wget -c https://raw.githubusercontent.com/ruzickap/packer-templates/master/{windows-server-2016-eval.json,Vagrantfile-windows.template} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment