summaryrefslogtreecommitdiff
path: root/packer/files/answer_files
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-07-11 21:50:55 +0300
committerheqnx <root@heqnx.com>2025-07-11 21:50:55 +0300
commit8cf16b5c899a60ea5982c5d8dc042153daf6ac5b (patch)
treed64092854fe32f4630f514b93b244b0b5eddc5d1 /packer/files/answer_files
parent54ecdd04947e70026c96365ea29463f8b435c1aa (diff)
downloadansible-active-directory-range-8cf16b5c899a60ea5982c5d8dc042153daf6ac5b.tar.gz
ansible-active-directory-range-8cf16b5c899a60ea5982c5d8dc042153daf6ac5b.zip
added packer templates
Diffstat (limited to 'packer/files/answer_files')
-rw-r--r--packer/files/answer_files/linux/ubuntu/24.04-server/meta-data0
-rw-r--r--packer/files/answer_files/linux/ubuntu/24.04-server/user-data39
-rw-r--r--packer/files/answer_files/windows/2019/autounattend.xml176
3 files changed, 215 insertions, 0 deletions
diff --git a/packer/files/answer_files/linux/ubuntu/24.04-server/meta-data b/packer/files/answer_files/linux/ubuntu/24.04-server/meta-data
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/packer/files/answer_files/linux/ubuntu/24.04-server/meta-data
diff --git a/packer/files/answer_files/linux/ubuntu/24.04-server/user-data b/packer/files/answer_files/linux/ubuntu/24.04-server/user-data
new file mode 100644
index 0000000..5e02023
--- /dev/null
+++ b/packer/files/answer_files/linux/ubuntu/24.04-server/user-data
@@ -0,0 +1,39 @@
+#cloud-config
+autoinstall:
+ version: 1
+ early-commands:
+ - systemctl stop ssh
+ locale: en_US.UTF-8
+ keyboard:
+ layout: us
+ variant: ""
+ storage:
+ layout:
+ name: lvm
+ identity:
+ hostname: ubuntu
+ username: ubuntu
+ password: "$6$R9142dko7PYoTTJP$o19g/Av.dsI/fVEF4SJ8v0XqRcG6YdhQRGYLFrW2X4BG4gO2z3dWyOwio3pRrFXBMHNZHJlZPUp9yvR7elRKs0"
+ ssh:
+ allow-pw: true
+ install-server: true
+ user-data:
+ disable_root: false
+ runcmd:
+ - 'echo "root:root" | chpasswd'
+ late-commands:
+ - rm -rf /target/etc/apt/preferences.d/90curtin.pref
+ - curtin in-target --target=/target -- lvextend --extents +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
+ - curtin in-target --target=/target -- resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
+ - echo 'PermitRootLogin yes' >> /target/etc/ssh/sshd_config
+ - chmod -x /target/etc/update-motd.d/*
+ - |
+ cat << EOF > /target/etc/netplan/99-dhcp-any-interface.yaml
+ network:
+ ethernets:
+ any_interface:
+ match:
+ name: "e*"
+ dhcp4: true
+ version: 2
+ EOF
diff --git a/packer/files/answer_files/windows/2019/autounattend.xml b/packer/files/answer_files/windows/2019/autounattend.xml
new file mode 100644
index 0000000..1f87720
--- /dev/null
+++ b/packer/files/answer_files/windows/2019/autounattend.xml
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="utf-8"?>
+<unattend xmlns="urn:schemas-microsoft-com:unattend">
+ <settings pass="windowsPE">
+ <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SetupUILanguage>
+ <UILanguage>en-US</UILanguage>
+ </SetupUILanguage>
+ <InputLocale>en-US</InputLocale>
+ <SystemLocale>en-US</SystemLocale>
+ <UILanguage>en-US</UILanguage>
+ <UserLocale>en-US</UserLocale>
+ </component>
+ <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS">
+ <DriverPaths>
+ <PathAndCredentials wcm:action="add" wcm:keyValue="1">
+ <Path>e:\</Path>
+ </PathAndCredentials>
+ </DriverPaths>
+ </component>
+ <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <DiskConfiguration>
+ <Disk wcm:action="add">
+ <CreatePartitions>
+ <CreatePartition wcm:action="add">
+ <Type>Primary</Type>
+ <Order>1</Order>
+ <Size>350</Size>
+ </CreatePartition>
+ <CreatePartition wcm:action="add">
+ <Order>2</Order>
+ <Type>Primary</Type>
+ <Extend>true</Extend>
+ </CreatePartition>
+ </CreatePartitions>
+ <ModifyPartitions>
+ <ModifyPartition wcm:action="add">
+ <Active>true</Active>
+ <Format>NTFS</Format>
+ <Label>boot</Label>
+ <Order>1</Order>
+ <PartitionID>1</PartitionID>
+ </ModifyPartition>
+ <ModifyPartition wcm:action="add">
+ <Format>NTFS</Format>
+ <Label>Windows 2019</Label>
+ <Letter>C</Letter>
+ <Order>2</Order>
+ <PartitionID>2</PartitionID>
+ </ModifyPartition>
+ </ModifyPartitions>
+ <DiskID>0</DiskID>
+ <WillWipeDisk>true</WillWipeDisk>
+ </Disk>
+ </DiskConfiguration>
+ <ImageInstall>
+ <OSImage>
+ <InstallFrom>
+ <MetaData wcm:action="add">
+ <Key>/IMAGE/NAME</Key>
+ <Value>Windows Server 2019 SERVERSTANDARD</Value>
+ </MetaData>
+ </InstallFrom>
+ <InstallTo>
+ <DiskID>0</DiskID>
+ <PartitionID>2</PartitionID>
+ </InstallTo>
+ </OSImage>
+ </ImageInstall>
+ <UserData>
+ <AcceptEula>true</AcceptEula>
+ </UserData>
+ </component>
+ </settings>
+ <settings pass="oobeSystem">
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <OOBE>
+ <HideEULAPage>true</HideEULAPage>
+ <HideOEMRegistrationScreen>true</HideOEMRegistrationScreen>
+ <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
+ <HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
+ <ProtectYourPC>3</ProtectYourPC>
+ </OOBE>
+ <UserAccounts>
+ <LocalAccounts>
+ <LocalAccount wcm:action="add">
+ <Password>
+ <Value>packer</Value>
+ <PlainText>true</PlainText>
+ </Password>
+ <Group>Administrators</Group>
+ <Name>packer</Name>
+ <DisplayName>packer</DisplayName>
+ </LocalAccount>
+ </LocalAccounts>
+ <AdministratorPassword>
+ <Value>packer</Value>
+ <PlainText>true</PlainText>
+ </AdministratorPassword>
+ </UserAccounts>
+ <AutoLogon>
+ <Username>packer</Username>
+ <Enabled>true</Enabled>
+ <Password>
+ <Value>packer</Value>
+ <PlainText>true</PlainText>
+ </Password>
+ </AutoLogon>
+ <FirstLogonCommands>
+ <SynchronousCommand wcm:action="add">
+ <Order>1</Order>
+ <Description>Disable the network discovery prompt window</Description>
+ <RequiresUserInput>false</RequiresUserInput>
+ <CommandLine>reg.exe add HKLM\System\CurrentControlSet\Control\Network\NewNetworkWindowOff</CommandLine>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <Order>2</Order>
+ <Description>Set Execution Policy 64 Bit</Description>
+ <RequiresUserInput>false</RequiresUserInput>
+ <CommandLine>cmd.exe /c powershell -c "set-executionpolicy -executionpolicy unrestricted -force"</CommandLine>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <Order>3</Order>
+ <Description>Set Execution Policy 32 Bit</Description>
+ <RequiresUserInput>false</RequiresUserInput>
+ <CommandLine>c:\windows\syswow64\cmd.exe /c powershell -c "set-executionpolicy -executionpolicy unrestricted -force"</CommandLine>
+ </SynchronousCommand>
+ <SynchronousCommand wcm:action="add">
+ <Order>500</Order>
+ <Description>Enable WinRM</Description>
+ <RequiresUserInput>false</RequiresUserInput>
+ <CommandLine>cmd.exe /c for %i in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %i:\enable-winrm-http.ps1 (call powershell -file %i:\enable-winrm-http.ps1)</CommandLine>
+ </SynchronousCommand>
+ </FirstLogonCommands>
+ </component>
+ <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <InputLocale>en-US</InputLocale>
+ <SystemLocale>en-US</SystemLocale>
+ <UILanguage>en-US</UILanguage>
+ <UserLocale>en-US</UserLocale>
+ </component>
+ </settings>
+ <settings pass="specialize">
+ <component name="Microsoft-Windows-TerminalServices-LocalSessionManager" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <fDenyTSConnections>false</fDenyTSConnections>
+ </component>
+ <component name="Networking-MPSSVC-Svc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <FirewallGroups>
+ <FirewallGroup wcm:action="add" wcm:keyValue="RemoteDesktop">
+ <Active>true</Active>
+ <Group>@FirewallAPI.dll,-28752</Group>
+ <Profile>all</Profile>
+ </FirewallGroup>
+ </FirewallGroups>
+ </component>
+ <component name="Microsoft-Windows-TerminalServices-RDP-WinStationExtensions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <SecurityLayer>1</SecurityLayer>
+ <UserAuthentication>0</UserAuthentication>
+ </component>
+ <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <CopyProfile>true</CopyProfile>
+ <TimeZone>UTC</TimeZone>
+ </component>
+ <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-ServerManager-SvrMgrNc" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+ <DoNotOpenServerManagerAtLogon>true</DoNotOpenServerManagerAtLogon>
+ </component>
+ <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+ <IEHardenAdmin>false</IEHardenAdmin>
+ <IEHardenUser>false</IEHardenUser>
+ </component>
+ <component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-OutOfBoxExperience" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
+ <DoNotOpenInitialConfigurationTasksAtLogon>true</DoNotOpenInitialConfigurationTasksAtLogon>
+ </component>
+ </settings>
+ <cpi:offlineImage cpi:source="" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
+</unattend>
+