Skip to content
Snippets Groups Projects
Commit b6e477ac authored by Alexander Olofsson's avatar Alexander Olofsson
Browse files

Add an unattend processorArchitecture method

parent 1f7a3e29
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,10 @@ module ForemanWds ...@@ -65,6 +65,10 @@ module ForemanWds
wds_facet || build_wds_facet wds_facet || build_wds_facet
end end
def unattend_arch
WdsServer.wdsify_processor_architecture(architecture)
end
def unattend_pass(password, suffix = nil) def unattend_pass(password, suffix = nil)
if suffix.nil? if suffix.nil?
suffix = password suffix = password
...@@ -105,5 +109,5 @@ module ForemanWds ...@@ -105,5 +109,5 @@ module ForemanWds
end end
class ::Host::Managed::Jail < Safemode::Jail class ::Host::Managed::Jail < Safemode::Jail
allow :unattend_pass, :wds_facet, :wds_server, :wds_install_image_file, :wds_install_image_group, :wds_install_image_name allow :unattend_arch, :unattend_pass, :wds_facet, :wds_server, :wds_install_image_file, :wds_install_image_group, :wds_install_image_name
end end
...@@ -136,6 +136,11 @@ class WdsServer < ApplicationRecord ...@@ -136,6 +136,11 @@ class WdsServer < ApplicationRecord
ForemanWds::WdsImage::WDS_ARCH_NAMES[wds_arch] ForemanWds::WdsImage::WDS_ARCH_NAMES[wds_arch]
end end
def self.wdsify_processor_architecture(architecture)
wds_arch = ForemanWds::WdsImage::WDS_IMAGE_ARCHES.find_index { |arch| arch =~ architecture.name }
ForemanWds::WdsImage::WDS_ARCH_NAMES[wds_arch]
end
def test_connection def test_connection
connection.run_wql('SELECT * FROM Win32_UTCTime').key? :win32_utc_time connection.run_wql('SELECT * FROM Win32_UTCTime').key? :win32_utc_time
rescue StandardError rescue StandardError
......
...@@ -31,7 +31,7 @@ end ...@@ -31,7 +31,7 @@ end
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend"> <unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE"> <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"> <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="<%= @host.unattend_arch %>" 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> <SetupUILanguage>
<UILanguage>en-US</UILanguage> <UILanguage>en-US</UILanguage>
</SetupUILanguage> </SetupUILanguage>
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
<SystemLocale>en-US</SystemLocale> <SystemLocale>en-US</SystemLocale>
<UserLocale>en-US</UserLocale> <UserLocale>en-US</UserLocale>
</component> </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"> <component name="Microsoft-Windows-Setup" processorArchitecture="<%= @host.unattend_arch %>" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<WindowsDeploymentServices> <WindowsDeploymentServices>
<Login> <Login>
<Credentials> <Credentials>
...@@ -73,7 +73,7 @@ end ...@@ -73,7 +73,7 @@ end
</settings> </settings>
<settings pass="specialize"> <settings pass="specialize">
<%- if realm -%> <%- if realm -%>
<component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="<%= @host.unattend_arch %>" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Identification> <Identification>
<JoinDomain><%= realm[:domain] %></JoinDomain> <JoinDomain><%= realm[:domain] %></JoinDomain>
<%- if realm[:type] == :machine -%> <%- if realm[:type] == :machine -%>
...@@ -92,13 +92,13 @@ end ...@@ -92,13 +92,13 @@ end
</Identification> </Identification>
</component> </component>
<%- end -%> <%- end -%>
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="<%= @host.unattend_arch %>" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ComputerName><%= @host.shortname %></ComputerName> <ComputerName><%= @host.shortname %></ComputerName>
<RegisteredOrganization><%= registration[:organization] %></RegisteredOrganization> <RegisteredOrganization><%= registration[:organization] %></RegisteredOrganization>
<RegisteredOwner><%= registration[:owner] %></RegisteredOwner> <RegisteredOwner><%= registration[:owner] %></RegisteredOwner>
<TimeZone><%= timezone %></TimeZone> <TimeZone><%= timezone %></TimeZone>
</component> </component>
<component name="Microsoft-Windows-TCPIP" 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"> <component name="Microsoft-Windows-TCPIP" processorArchitecture="<%= @host.unattend_arch %>" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Interfaces> <Interfaces>
<%- iface = @host.primary_interface # @host.managed_interfaces.each.with_index do |iface, i| -%> <%- iface = @host.primary_interface # @host.managed_interfaces.each.with_index do |iface, i| -%>
<Interface wcm:action="add"> <Interface wcm:action="add">
...@@ -132,7 +132,7 @@ end ...@@ -132,7 +132,7 @@ end
</Interface> </Interface>
</Interfaces> </Interfaces>
</component> </component>
<component name="Microsoft-Windows-DNS-Client" 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"> <component name="Microsoft-Windows-DNS-Client" processorArchitecture="<%= @host.unattend_arch %>" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DNSSuffixSearchOrder> <DNSSuffixSearchOrder>
<DomainName wcm:action="add" wcm:keyValue="1"><%= @host.domain %></DomainName> <DomainName wcm:action="add" wcm:keyValue="1"><%= @host.domain %></DomainName>
</DNSSuffixSearchOrder> </DNSSuffixSearchOrder>
...@@ -150,7 +150,7 @@ end ...@@ -150,7 +150,7 @@ end
</component> </component>
</settings> </settings>
<settings pass="oobeSystem"> <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"> <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="<%= @host.unattend_arch %>" 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> <OOBE>
<HideEULAPage>true</HideEULAPage> <HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen> <HideLocalAccountScreen>true</HideLocalAccountScreen>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment