The template in this example is based on the SUSE CaaS Platform 4 template, customized to make use of Uyuni. It includes channels and client registration scripts to install a SUSE CaaS Platform 4 cluster with Uyuni autoinstallation. This script is intended for you to use as a basis for your own autoinstallation scripts.
Example: Script for autoinstallation of a SUSE CaaS Platform 4 node
<?xml version="1.0"?> <!DOCTYPE profile> <profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <bootloader> <global> <generic_mbr>true</generic_mbr> <gfxmode>auto</gfxmode> <hiddenmenu>false</hiddenmenu> <os_prober>false</os_prober> <terminal>gfxterm</terminal> <timeout config:type="integer">8</timeout> <suse_btrfs config:type="boolean">true</suse_btrfs> </global> </bootloader> <general> <ask-list config:type="list"/> <mode> <confirm config:type="boolean">false</confirm> </mode> <proposals config:type="list"/> <storage> <partition_alignment config:type="symbol">align_optimal</partition_alignment> <start_multipath config:type="boolean">false</start_multipath> </storage> <signature-handling> <accept_file_without_checksum config:type="boolean">true</accept_file_without_checksum> <accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key> <accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key> <accept_unsigned_file config:type="boolean">true</accept_unsigned_file> <accept_verification_failed config:type="boolean">false</accept_verification_failed> <import_gpg_key config:type="boolean">true</import_gpg_key> </signature-handling> </general> <!-- configure local storage --> <partitioning config:type="list"> <drive> <use>all</use> <partitions config:type="list"> <partition> <mount>/boot/efi</mount> <size>200mb</size> <partition_id config:type="integer">1</partition_id> <filesystem config:type="symbol">vfat</filesystem> </partition> <partition> <filesystem config:type="symbol">ext4</filesystem> <mount>/</mount> <size>max</size> </partition> </partitions> </drive> </partitioning> <!-- don't import any ssh configuration from previously-installed OS --> <ssh_import> <copy_config config:type="boolean">false</copy_config> <import config:type="boolean">false</import> </ssh_import> <!-- configure language and timezone --> <keyboard> <keymap>english-us</keymap> </keyboard> <language> <language>en_US</language> <languages/> </language> <timezone> <hwclock>UTC</hwclock> <timezone>Etc/GMT</timezone> </timezone> <!-- set up networking --> <networking> <dhcp_options> <dhclient_client_id/> <dhclient_hostname_option>AUTO</dhclient_hostname_option> </dhcp_options> <dns> <dhcp_hostname config:type="boolean">true</dhcp_hostname> <resolv_conf_policy>auto</resolv_conf_policy> <write_hostname config:type="boolean">false</write_hostname> </dns> <interfaces config:type="list"> <interface> <bootproto>dhcp</bootproto> <device>eth0</device> <dhclient_set_default_route>yes</dhclient_set_default_route> <startmode>auto</startmode> </interface> <interface> <bootproto>static</bootproto> <device>lo</device> <firewall>no</firewall> <ipaddr>127.0.0.1</ipaddr> <netmask>255.0.0.0</netmask> <network>127.0.0.0</network> <prefixlen>8</prefixlen> <startmode>nfsroot</startmode> <usercontrol>no</usercontrol> </interface> </interfaces> <ipv6 config:type="boolean">true</ipv6> <keep_install_network config:type="boolean">true</keep_install_network> <setup_before_proposal config:type="boolean">true</setup_before_proposal> <managed config:type="boolean">false</managed> <routing> <ipv4_forward config:type="boolean">true</ipv4_forward> <ipv6_forward config:type="boolean">true</ipv6_forward> </routing> </networking> <!-- configure ntp client --> <ntp-client> <ntp_policy>auto</ntp_policy> <ntp_servers config:type="list"> <ntp_server> <!-- replace ntp server address value bellow with one from your infrastructure --> <address>0.novell.pool.ntp.org</address> <iburst config:type="boolean">true</iburst> <offline config:type="boolean">true</offline> </ntp_server> </ntp_servers> <ntp_sync>systemd</ntp_sync> </ntp-client> <!-- install required packages --> <software> <image/> <products config:type="list"> <product>SLES</product> </products> <instsource/> <patterns config:type="list"> <pattern>base</pattern> <pattern>enhanced_base</pattern> <pattern>minimal_base</pattern> <pattern>basesystem</pattern> </patterns> <packages config:type="list"> <package>sles-release</package> <package>sle-module-containers-release</package> <package>sle-module-basesystem-release</package> <package>caasp-release</package> </packages> </software> <services-manager> <default_target>multi-user</default_target> <services> <disable config:type="list"> <service>purge-kernels</service> </disable> <enable config:type="list"> <service>sshd</service> <service>chronyd</service> </enable> </services> </services-manager> <!-- disable root password and add ssh keys --> <users config:type="list"> <user> <username>root</username> <user_password>linux</user_password> <encrypted config:type="boolean">false</encrypted> </user> <user> <username>sles</username> <user_password>linux</user_password> <encrypted config:type="boolean">false</encrypted> </user> </users> <add-on> <add_on_products config:type="list"> <listentry> <ask_on_error config:type="boolean">true</ask_on_error> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-basesystem15-sp1-pool-x86_64/$distrotree</media_url> <name>sle-module-basesystem15-sp1-pool-x86_64</name> <product>sle-module-basesystem15-sp1-pool-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <ask_on_error config:type="boolean">true</ask_on_error> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-basesystem15-sp1-updates-x86_64/$distrotree</media_url> <name>sle-module-basesystem15-sp1-updates-x86_64</name> <product>sle-module-basesystem15-sp1-updates-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <ask_on_error config:type="boolean">true</ask_on_error> <media_url>http://$redhat_management_server/ks/dist/child/sle-product-sles15-sp1-updates-x86_64/$distrotree</media_url> <name>sle-product-sles15-sp1-updates-x86_64</name> <product>sle-product-sles15-sp1-updates-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <ask_on_error config:type="boolean">true</ask_on_error> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-server-applications15-sp1-pool-x86_64/$distrotree</media_url> <name>sle-module-server-applications15-sp1-pool-x86_64</name> <product>sle-module-server-applications15-sp1-pool-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <ask_on_error config:type="boolean">true</ask_on_error> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-server-applications15-sp1-updates-x86_64/$distrotree</media_url> <name>sle-module-server-applications15-sp1-updates-x86_64</name> <product>sle-module-server-applications15-sp1-updates-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/sle-manager-tools15-pool-x86_64-sp1/$distrotree</media_url> <name>sle-manager-tools15-pool-x86_64-sp1</name> <product>sle-manager-tools15-pool-x86_64-sp1</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/sle-manager-tools15-pool-x86_64-sp1/$distrotree</media_url> <name>sle-manager-tools15-updates-x86_64-sp1</name> <product>sle-manager-tools15-updates-x86_64-sp1</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-containers15-sp1-pool-x86_64/$distrotree</media_url> <name>sle-module-containers15-sp1-pool-x86_64 </name> <product>sle-module-containers15-sp1-pool-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/sle-module-containers15-sp1-updates-x86_64/$distrotree</media_url> <name>sle-module-containers15-sp1-updates-x86_64</name> <product>sle-module-containers15-sp1-updates-x86_64</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/suse-caasp-4.0-pool-x86_64-sp1/$distrotree</media_url> <name>suse-caasp-4.0-pool-x86_64-sp1</name> <product>suse-caasp-4.0-pool-x86_64-sp1</product> <product_dir>/</product_dir> </listentry> <listentry> <media_url>http://$redhat_management_server/ks/dist/child/suse-caasp-4.0-updates-x86_64-sp1/$distrotree</media_url> <name>suse-caasp-4.0-updates-x86_64-sp1</name> <product>suse-caasp-4.0-updates-x86_64-sp1</product> <product_dir>/</product_dir> </listentry> </add_on_products> </add-on> <!-- register --> <suse_register> <do_registration config:type="boolean">true</do_registration> <install_updates config:type="boolean">true</install_updates> <email><!-- replace this comment with an email address used for registration --></email> <reg_code><!-- replace this comment with a CaaSP registration code --></reg_code> <slp_discovery config:type="boolean">false</slp_discovery> <addons config:type="list"> <addon> <name>sle-module-containers</name> <version>15.1</version> <arch>x86_64</arch> </addon> <addon> <name>caasp</name> <version>4.0</version> <arch>x86_64</arch> <reg_code><!-- replace this comment with a CaaSP registration code --></reg_code> </addon> </addons> </suse_register> <scripts> <chroot-scripts config:type="list"> <script> <chrooted config:type="boolean">true</chrooted> <filename>add_sles_sudo_rule.sh</filename> <interpreter>shell</interpreter> <source> <![CDATA[ #!/bin/sh echo "Defaults:sles !targetpw sles ALL=(ALL,ALL) NOPASSWD: ALL" > /etc/sudoers.d/sles ]]> </source> </script> </chroot-scripts> <init-scripts config:type="list"> $SNIPPET('spacewalk/minion_script') </init-scripts> </scripts> </profile>