2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-23 19:52:10 +00:00

OpenSUSE 15.3 support

A number of changes in opensuse 15.3 require modifying our
strategy.

No more XInclude. This seems to be unintentional, but it released
and so we will work around it.

Some somewhat incorrect values, as pointed out by new validation.
This commit is contained in:
Jarrod Johnson 2021-06-22 12:19:54 -04:00
parent f0693f6ee5
commit e34d76f7eb
3 changed files with 27 additions and 20 deletions

View File

@ -1,17 +1,17 @@
<?xml version="1.0"?>
<!DOCTYPE profile SYSTEM "/usr/share/YaST2/include/autoinstall/profile.dtd">
<!DOCTYPE profile>
<!--
This autoyast file will be processed by pre.sh before applying. See pre.sh for
info on modifying its behavior, and also search and replace '%%' to remove
dynamic behavior and replace with static configuration.
-->
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns" xmlns:xi="http://www.w3.org/2001/XInclude">
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<timezone>
<hwclock>UTC</hwclock>
<!--INSERT:/tmp/timezone-->
</timezone>
<general>
<self_update config:type="boolean">false</self_update>
<clock>
<hwclock>UTC</hwclock>
<xi:include href="file:///tmp/timezone"/>
</clock>
<mode>
<confirm config:type="boolean">false</confirm>
</mode>
@ -19,16 +19,16 @@ dynamic behavior and replace with static configuration.
%%IFSLE%%
<add-on>
<add_on_products config:type="list">
<listentry><xi:include href="file:///tmp/pkgurl"/><product>sle-module-basesystem</product><product_dir>/Module-Basesystem</product_dir></listentry>
<listentry><xi:include href="file:///tmp/pkgurl"/><product>sle-module-hpc</product><product_dir>/Module-HPC</product_dir></listentry>
<listentry><xi:include href="file:///tmp/pkgurl"/><product>sle-module-server-applications</product><product_dir>/Module-Server-Applications</product_dir></listentry>
<listentry><xi:include href="file:///tmp/pkgurl"/><product>sle-module-containers</product><product_dir>/Module-Containers</product_dir></listentry>
<listentry><xi:include href="file:///tmp/pkgurl"/><product>SLE_HPC</product><product_dir>/Product-HPC</product_dir></listentry>
<listentry><xi:include href="file:///tmp/pkgurl"/><product>Legacy-Module</product><product_dir>/Module-Legacy</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>sle-module-basesystem</product><product_dir>/Module-Basesystem</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>sle-module-hpc</product><product_dir>/Module-HPC</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>sle-module-server-applications</product><product_dir>/Module-Server-Applications</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>sle-module-containers</product><product_dir>/Module-Containers</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>SLE_HPC</product><product_dir>/Product-HPC</product_dir></listentry>
<listentry><!--INSERT:/tmp/pkgurl--><product>Legacy-Module</product><product_dir>/Module-Legacy</product_dir></listentry>
</add_on_products>
</add-on>
%%ENDIFSLE%%
<xi:include href="file:///tmp/bootloader.xml"/>
<!--INSERT:/tmp/bootloader.xml-->
<software>
%%IFSLE%%
<products config:type="list">
@ -39,6 +39,7 @@ dynamic behavior and replace with static configuration.
<pattern>base</pattern>
</patterns>
<packages config:type="list">
<package>openssh</package>
<package>python3</package>
<package>openssl</package>
<package>chrony</package>
@ -79,7 +80,7 @@ dynamic behavior and replace with static configuration.
<username>root</username>
<user_password>%%ROOTPASSWORD%%</user_password>
<encrypted config:type="boolean">true</encrypted>
<xi:include href="file:///tmp/rootkeys.xml"/>
<!--INSERT:/tmp/rootkeys.xml-->
</user>
</users>
<networking>
@ -99,7 +100,6 @@ dynamic behavior and replace with static configuration.
<pre-scripts config:type="list">
<script>
<filename>preinstall.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[
#!/bin/sh
@ -115,7 +115,6 @@ curl $proto://$confluent_mgr/confluent-public/os/$confluent_profile/scripts/pre.
<chroot-scripts config:type="list">
<script>
<filename>chroot.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[
#!/bin/sh
@ -135,14 +134,12 @@ cp /mnt/etc/confluent/post.sh /mnt/var/adm/autoinstall/scripts/
<script>
<chrooted config:type="boolean">true</chrooted>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<location>file:///etc/confluent/post.sh</location>
</script>
</chroot-scripts>
<init-scripts config:type="list">
<script>
<filename>firstboot.sh</filename>
<interpreter>shell</interpreter>
<location>file:///etc/confluent/firstboot.sh</location>
</script>
</init-scripts>

View File

@ -16,5 +16,5 @@ profile=$(basename $2)
if [[ $profile =~ ^sle.* ]]; then
sed -i 's/%%IFSLE%%//;s/%%ENDIFSLE%%//' $2/autoyast
else
sed -i 's/%%IFSLE%%/<!--/;s/%%ENDIFSLE%%/-->/' $2/autoyast
sed -i '/%%IFSLE%%/<!--/,/%%ENDIFSLE%%/d' $2/autoyast
fi

View File

@ -38,4 +38,14 @@ if grep ^ntpservers: /etc/confluent/confluent.deploycfg > /dev/null; then
ntpcfg=$(paste -sd '' /tmp/ntp.cfg)
fi
run_remote_python getinstalldisk
sed -e s!%%INSTDISK%%!/dev/$(cat /tmp/installdisk)! -e s!%%NODENAME%%!$nodename! -e "s!<networking>!$ntpcfg<networking>!" -e "s?%%ROOTPASSWORD%%?${rootpw}?" /tmp/profile/autoinst.xml > /tmp/profile/modified.xml
sed -e s'!'%%INSTDISK%%'!'/dev/$(cat /tmp/installdisk)'!' -e s'!'%%NODENAME%%'!'$nodename'!' -e s'!<networking>!'$ntpcfg'<networking>!' -e "s?%%ROOTPASSWORD%%?${rootpw}?" /tmp/profile/autoinst.xml > /tmp/profile/modified.xml
#This would be nice, but suse discards comments before it makes it to /tmp/profile
#for file in $(grep '<!--INSERT' /tmp/profile/modified.xml |sed -e s/.*INSERT:// -e 's/-->//'); do
# sed -i 's%<!--INSERT:'${file}'-->'"%$(cat $file|tr -d '\n')"% /tmp/profile/modified.xml
#done
if grep append /tmp/bootloader.xml > /dev/null; then
sed -i 's@</general>@</general>'"$(tr -d '\n' < /tmp/bootloader.xml)"'@' /tmp/profile/modified.xml
fi
sed -i 's#root</username>#root</username>'"$(tr -d '\n' < /tmp/rootkeys.xml)"'#' /tmp/profile/modified.xml
sed -i 's@/hwclock>@/hwclock>'"$(tr -d '\n' < /tmp/timezone)"'@' /tmp/profile/modified.xml
sed -i 's@<product_dir>@'"$(tr -d '\n' < /tmp/pkgurl)"'<product_dir>@' /tmp/profile/modified.xml