Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #36947 - Broken openSUSE Leap 15 provisioning #9927

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST entire SCSI disk
model: Ptable
oses:
- SLES
- OpenSUSE
- openSUSE
%>
<partitioning config:type="list">
<drive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST entire virtual disk
model: Ptable
oses:
- SLES
- OpenSUSE
- openSUSE
%>
<partitioning config:type="list">
<drive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST LVM
model: Ptable
oses:
- SLES
- OpenSUSE
- openSUSE
%>
<partitioning config:type="list">
<drive>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST default PXEGrub
model: ProvisioningTemplate
oses:
- SLES
- OpenSUSE
- openSUSE
description: |
The template to render PXEGrub bootloader configuration for AutoYaST based distributions.
The output is deployed on the host's subnet TFTP proxy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST default PXEGrub2
model: ProvisioningTemplate
oses:
- SLES
- OpenSUSE
- openSUSE
description: |
The template to render PXEGrub2 bootloader configuration for AutoYaST based distributions.
The output is deployed on the host's subnet TFTP proxy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: AutoYaST default PXELinux
model: ProvisioningTemplate
oses:
- SLES
- OpenSUSE
- openSUSE
description: |
The template to render PXELinux bootloader configuration for SLES and OpenSUSE distributions.
The output is deployed on the host's subnet TFTP proxy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: AutoYaST default iPXE
model: ProvisioningTemplate
oses:
- SLES
- OpenSUSE
- openSUSE
description: |
The template to render iPXE installation script for SLES and OpenSUSE
The output is deployed on the host's subnet TFTP proxy.
Expand All @@ -18,6 +18,15 @@ if host_param('http-proxy') && host_param('http-proxy-port')
elsif host_param('http-proxy')
extra_args << "proxy=http://" + host_param('http-proxy')
end

subnet = @host.subnet
if subnet.respond_to?(:dhcp_boot_mode?) && subnet.dhcp_boot_mode?
extra_args << "useDHCP=1"
else
extra_args << "netsetup=-dhcp"
extra_args << "ifcfg=*=\"${netX/ip}/#{@host.primary_interface.subnet.cidr},${netX/gateway},${dns},#{@host.domain}\""
end
extra_args << "BOOTIF=01-${netX/mac:hexhyp}"
-%>
echo Trying to ping Gateway: ${netX/gateway}
ping --count 1 ${netX/gateway} || echo Ping to Gateway failed or ping command not available.
Expand All @@ -28,11 +37,6 @@ ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not availa
<% kernel = boot_files_uris[0] -%>
<% initrd = boot_files_uris[1] -%>

<% subnet = @host.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) && subnet.dhcp_boot_mode? -%>
kernel <%= kernel %> initrd=initrd.img splash=silent install=<%= medium_uri %> autoyast=<%= foreman_url('provision') %> text-mode=1 useDHCP=1 <%= extra_args.join(' ')%>
<% else -%>
kernel <%= kernel %> initrd=initrd.img splash=silent install=<%= medium_uri %> autoyast=<%= foreman_url('provision') %> text-mode=1 useDHCP=0 netsetup=-dhcp ifcfg=*="${netX/ip}/<%= @host.primary_interface.subnet.cidr -%>,${netX/gateway},${dns},<%= @host.domain %>" <%= extra_args.join(' ')%>
<% end -%>
initrd <%= initrd %>
kernel <%= kernel %> initrd=initrd.img splash=silent install=<%= medium_uri %> autoyast=<%= foreman_url('provision') %> text-mode=1 <%= extra_args.join(' ')%>
initrd --name initrd.img <%= initrd %>
boot
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ kind: provision
name: AutoYaST default
model: ProvisioningTemplate
oses:
- OpenSUSE
- openSUSE
description: |
Provisioning template for the OpenSUSE AutoYaST installer.
-%>
<%
# safemode renderer does not support unary negation
aio_enabled = host_param_true?('enable-puppetlabs-repo') || %w[official-puppet8 official-puppet7].any? { |repo| host_param_true?("enable-#{repo}-repo") }
puppet_enabled = !host_param_true?('skip-puppet-setup') && (host_puppet_server.present? || host_param_true?('force-puppet'))
salt_enabled = host_param('salt_master') ? true : false
os_major = @host.operatingsystem.major.to_i
os_minor = @host.operatingsystem.minor.to_i
primary_interface_identifier = @host.primary_interface.identifier.blank? ? 'eth0' : @host.primary_interface.identifier
primary_interface_subnet = @host.primary_interface.subnet
-%>
Expand All @@ -29,7 +31,9 @@ description: |
<hostname><%= @host.name %></hostname>
<% unless primary_interface_subnet.dhcp_boot_mode? -%>
<dhcp_hostname config:type="boolean">false</dhcp_hostname>
<% if os_major < 12 -%>
<dhcp_resolv config:type="boolean">false</dhcp_resolv>
<% end -%>
<% if @host.domain -%>
<domain><%= @host.domain -%></domain>
<% end -%>
Expand Down Expand Up @@ -96,9 +100,18 @@ description: |
</routing>
<% end -%>
</networking>
<%# NTP client configuration has incompatible changes in Leap 15 -%>
<% if os_major <= 12 || os_major == 42 -%>
<ntp-client>
<% if os_major >= 15 -%>
<ntp_policy>auto</ntp_policy>
<ntp_servers config:type="list">
<ntp_server>
<address><%= host_param('ntp-server') || '0.opensuse.pool.ntp.org' %></address>
<iburst config:type="boolean">false</iburst>
<offline config:type="boolean">true</offline>
</ntp_server>
</ntp_servers>
<ntp_sync>15</ntp_sync>
<% else -%>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
Expand All @@ -110,23 +123,21 @@ description: |
</peers>
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<% else -%>
<ntp-client>
<ntp_policy>auto</ntp_policy>
<ntp_servers config:type="list">
<ntp_server>
<iburst config:type="boolean">false</iburst>
<address><%= host_param('ntp-server') || '0.opensuse.pool.ntp.org' %></address>
<offline config:type="boolean">true</offline>
</ntp_server>
</ntp_servers>
<ntp_sync>systemd</ntp_sync>
</ntp-client>
<% end -%>
</ntp-client>
<% if ! @dynamic -%>
<%= @host.diskLayout %>
<%= @host.diskLayout %>
<% end -%>
<% if os_major >= 15 -%>
<services-manager>
<default_target>multi-user</default_target>
<services>
<enable config:type="list">
<service>sshd</service>
</enable>
</services>
</services-manager>
<% else -%>
<runlevel>
<default>3</default>
<services config:type="list">
Expand All @@ -136,8 +147,11 @@ description: |
</service>
</services>
</runlevel>
<% end -%>
<software>
<% if os_major < 15 -%>
<base>default</base>
<% end -%>
<patterns config:type="list">
<pattern>base</pattern>
<pattern>enhanced_base</pattern>
Expand All @@ -147,8 +161,12 @@ description: |
<packages config:type="list">
<package>lsb-release</package>
<% if puppet_enabled -%>
<% if aio_enabled -%>
<package>puppet-agent</package>
<% else -%>
<package>rubygem-puppet</package>
<% end -%>
<% end -%>
<% if host_param('additional-packages').present? -%>
<%= host_param('additional-packages').split(" ").collect{|x| "<package>#{x}</package>" }.join("\n") %>
<% end -%>
Expand Down Expand Up @@ -181,6 +199,7 @@ description: |
</pre-scripts>
<% end -%>
<chroot-scripts config:type="list">
<% if os_major < 15 -%>
<script>
<filename>cp-resolv.sh</filename>
<chrooted config:type="boolean">false</chrooted>
Expand All @@ -191,6 +210,7 @@ cp /etc/resolv.conf /mnt/etc
]]>
</source>
</script>
<% end -%>
<script>
<filename>foreman.sh</filename>
<chrooted config:type="boolean">true</chrooted>
Expand Down Expand Up @@ -224,11 +244,56 @@ rm /etc/resolv.conf
</script>
</chroot-scripts>
</scripts>
<% if os_major >= 15 -%>
<firewall>
<enable_firewall config:type="boolean">true</enable_firewall>
<log_denied_packets>off</log_denied_packets>
<default_zone>public</default_zone>
<zones config:type="list">
<zone>
<name>public</name>
<services config:type="list">
<service>ssh</service>
<service>dhcpv6-client</service>
</services>
</zone>
</zones>
</firewall>
<% end -%>
<keyboard>
<keymap>english-us</keymap>
</keyboard>
<timezone>
<hwclock>UTC</hwclock>
<timezone><%= host_param('time-zone') || 'Etc/UTC' %></timezone>
</timezone>
<add-on>
<add_on_others config:type="list">
<% if puppet_enabled && aio_enabled -%>
<%
puppet_repo_url_base = 'https://yum.puppet.com'
if host_param_true?('enable-official-puppet8-repo')
puppet_repo_url = "#{puppet_repo_url_base}/puppet8/sles/#{os_major}/#{@host.architecture}/"
puppet_repo_alias = 'puppet8-release'
elsif host_param_true?('enable-official-puppet7-repo')
puppet_repo_url = "#{puppet_repo_url_base}/puppet7/sles/#{os_major}/#{@host.architecture}/"
puppet_repo_alias = 'puppet7-release'
else
puppet_repo_url = "#{puppet_repo_url_base}/puppet/sles/#{os_major}/#{@host.architecture}/"
puppet_repo_alias = 'puppet-release'
end
-%>
<listentry>
<media_url><![CDATA[<%= puppet_repo_url %>]]></media_url>
<alias><%= puppet_repo_alias %></alias>
<name>Puppet AutoYaST repository</name>
<signature-handling>
<import_gpg_key>
<all config:type="boolean">true</all>
</import_gpg_key>
</signature-handling>
</listentry>
<% end -%>
</add_on_others>
</add-on>
</profile>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description: |
os_name = @host.operatingsystem.name

aio_enabled = host_param_true?('enable-puppetlabs-repo') || host_param_true?('enable-official-puppet8-repo') || host_param_true?('enable-puppet8') || host_param_true?('enable-official-puppet7-repo') || host_param_true?('enable-puppet7') || host_param_true?('enable-puppetlabs-puppet6-repo') || host_param_true?('enable-puppet6') || host_param_true?('enable-puppetlabs-puppet5-repo') || host_param_true?('enable-puppet5')
aio_available = os_family == 'Debian' || os_family == 'Redhat' || os_name == 'SLES'
aio_available = os_family == 'Debian' || os_family == 'Redhat' || os_family == 'Suse'
sbernhard marked this conversation as resolved.
Show resolved Hide resolved

if os_family == 'Windows'
var_dir = 'C:\ProgramData\PuppetLabs\puppet\cache'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: user_data
name: AutoYaST default user data
model: ProvisioningTemplate
oses:
- OpenSUSE
- openSUSE
- SLES
description: |
This template is used during image based provisioning, when the image is configured to use user-data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ echo Trying to ping DNS: ${netX/dns}
ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not available.


kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img splash=silent install=http://mirror.centos.org/centos/7/os/x86_64 autoyast=http://foreman.example.com/unattended/provision text-mode=1 useDHCP=1
initrd http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img
kernel http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/vmlinuz initrd=initrd.img splash=silent install=http://mirror.centos.org/centos/7/os/x86_64 autoyast=http://foreman.example.com/unattended/provision text-mode=1 useDHCP=1 BOOTIF=01-${netX/mac:hexhyp}
initrd --name initrd.img http://mirror.centos.org/centos/7/os/x86_64/images/pxeboot/initrd.img
boot
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</interface>
</interfaces>
</networking>
<ntp-client>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
Expand All @@ -37,7 +37,7 @@
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
zerombr
zerombr
clearpart --all --initlabel
part /boot --fstype ext3 --size=100 --asprimary
part / --fstype ext3 --size=1024 --grow
Expand Down Expand Up @@ -203,4 +203,8 @@ rm /etc/resolv.conf
<hwclock>UTC</hwclock>
<timezone>Etc/UTC</timezone>
</timezone>
<add-on>
<add_on_others config:type="list">
</add_on_others>
</add-on>
</profile>
Loading