diff --git a/_includes/autoinstall_done b/_includes/autoinstall_done new file mode 100644 index 00000000..741d02f6 --- /dev/null +++ b/_includes/autoinstall_done @@ -0,0 +1,62 @@ +#set system_name = $getVar('system_name','') +#set profile_name = $getVar('profile_name','') +#if $system_name != '' + #set object_type = 'system' + #set object_name = $system_name +#else if $profile_name != '' + #set object_type = 'profile' + #set object_name = $profile_name +#else + #set object_type = '' + #set object_name = '' +#end if +#set breed = $getVar('breed','') +#set os_version = $getVar('os_version','') +#set srv = $getVar('http_server','') +#set autoinstall = $getVar('autoinstall','') +#set run_install_triggers = $getVar('run_install_triggers','') +#set pxe_just_once = $getVar('pxe_just_once','') +#set nopxe = "" +#set save_autoinstall = "" +#set runpost = "" +#if $system_name != '' + ## PXE JUST ONCE + #if $pxe_just_once + #if $breed == 'redhat' + #set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -o /dev/null" % (srv, system_name) + #else if $breed == 'vmware' and $os_version == 'esx4' + #set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -o /dev/null" % (srv, system_name) + #else + #set nopxe = "\nwget \"http://%s/cblr/svc/op/nopxe/system/%s\" -O /dev/null" % (srv, system_name) + #end if + #end if +#end if +#if $object_type != '' + ## SAVE AUTO INSTALLATION + #if $autoinstall != '' + #if $breed == 'redhat' + #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.ks" % (srv, object_type, object_name) + #else if $breed == 'suse' + #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.xml" % (srv, object_type, object_name) + #else if $breed == 'vmware' and $os_version == 'esx4' + #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.ks" % (srv, object_type, object_name) + #else if $breed == 'vmware' + #set save_autoinstall = "\nwget \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -O /var/log/cobbler.ks" % (srv, object_type, object_name) + #else if $breed == 'debian' or $breed == 'ubuntu' + #set save_autoinstall = "\nwget \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -O /var/log/cobbler.seed" % (srv, object_type, object_name) + #end if + #end if + ## RUN POST TRIGGER + #if $run_install_triggers + #if $breed == 'redhat' or $breed == 'suse' + #set runpost = "\ncurl \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -o /dev/null" % (srv, object_type, object_name) + #else if $breed == 'vmware' and $os_version == 'esx4' + #set runpost = "\ncurl \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -o /dev/null" % (srv, object_type, object_name) + #else + #set runpost = "\nwget \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -O /dev/null" % (srv, object_type, object_name) + #end if + #end if +#end if +#echo $nopxe +#echo $save_autoinstall +#echo $runpost diff --git a/_includes/autoinstall_done.md b/_includes/autoinstall_done.md deleted file mode 100644 index 683061a9..00000000 --- a/_includes/autoinstall_done.md +++ /dev/null @@ -1,62 +0,0 @@ - #set system_name = $getVar('system_name','') - #set profile_name = $getVar('profile_name','') - #if $system_name != '' - #set object_type = 'system' - #set object_name = $system_name - #else if $profile_name != '' - #set object_type = 'profile' - #set object_name = $profile_name - #else - #set object_type = '' - #set object_name = '' - #end if - #set breed = $getVar('breed','') - #set os_version = $getVar('os_version','') - #set srv = $getVar('http_server','') - #set autoinstall = $getVar('autoinstall','') - #set run_install_triggers = $getVar('run_install_triggers','') - #set pxe_just_once = $getVar('pxe_just_once','') - #set nopxe = "" - #set save_autoinstall = "" - #set runpost = "" - #if $system_name != '' - ## PXE JUST ONCE - #if $pxe_just_once - #if $breed == 'redhat' - #set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -o /dev/null" % (srv, system_name) - #else if $breed == 'vmware' and $os_version == 'esx4' - #set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -o /dev/null" % (srv, system_name) - #else - #set nopxe = "\nwget \"http://%s/cblr/svc/op/nopxe/system/%s\" -O /dev/null" % (srv, system_name) - #end if - #end if - #end if - #if $object_type != '' - ## SAVE AUTO INSTALLATION - #if $autoinstall != '' - #if $breed == 'redhat' - #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.ks" % (srv, object_type, object_name) - #else if $breed == 'suse' - #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.xml" % (srv, object_type, object_name) - #else if $breed == 'vmware' and $os_version == 'esx4' - #set save_autoinstall = "\ncurl \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -o /root/cobbler.ks" % (srv, object_type, object_name) - #else if $breed == 'vmware' - #set save_autoinstall = "\nwget \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -O /var/log/cobbler.ks" % (srv, object_type, object_name) - #else if $breed == 'debian' or $breed == 'ubuntu' - #set save_autoinstall = "\nwget \"http://%s/cblr/svc/op/autoinstall/%s/%s\" -O /var/log/cobbler.seed" % (srv, object_type, object_name) - #end if - #end if - ## RUN POST TRIGGER - #if $run_install_triggers - #if $breed == 'redhat' or $breed == 'suse' - #set runpost = "\ncurl \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -o /dev/null" % (srv, object_type, object_name) - #else if $breed == 'vmware' and $os_version == 'esx4' - #set runpost = "\ncurl \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -o /dev/null" % (srv, object_type, object_name) - #else - #set runpost = "\nwget \"http://%s/cblr/svc/op/trig/mode/post/%s/%s\" -O /dev/null" % (srv, object_type, object_name) - #end if - #end if - #end if - #echo $nopxe - #echo $save_autoinstall - #echo $runpost diff --git a/_includes/autoinstall_start b/_includes/autoinstall_start new file mode 100644 index 00000000..267b6701 --- /dev/null +++ b/_includes/autoinstall_start @@ -0,0 +1,27 @@ +#set system_name = $getVar('system_name','') +#set profile_name = $getVar('profile_name','') +#if $system_name != '' + #set object_type = 'system' + #set object_name = $system_name +#else if $profile_name != '' + #set object_type = 'profile' + #set object_name = $profile_name +#else + #set object_type = '' + #set object_name = '' +#end if +#set breed = $getVar('breed','') +#set srv = $getVar('http_server','') +#set run_install_triggers = $getVar('run_install_triggers','') +#set runpre = "" +#if $object_type != '' + ## RUN PRE TRIGGER + #if $run_install_triggers + #if $breed == 'redhat' or $breed == 'suse' + #set runpre = "\ncurl \"http://%s/cblr/svc/op/trig/mode/pre/%s/%s\" -o /dev/null" % (srv, object_type, object_name) + #else + #set runpre = "\nwget \"http://%s/cblr/svc/op/trig/mode/pre/%s/%s\" -O /dev/null" % (srv, object_type, object_name) + #end if + #end if +#end if +#echo $runpre diff --git a/_includes/autoinstall_start.md b/_includes/autoinstall_start.md deleted file mode 100644 index 9eb46f0e..00000000 --- a/_includes/autoinstall_start.md +++ /dev/null @@ -1,27 +0,0 @@ - #set system_name = $getVar('system_name','') - #set profile_name = $getVar('profile_name','') - #if $system_name != '' - #set object_type = 'system' - #set object_name = $system_name - #else if $profile_name != '' - #set object_type = 'profile' - #set object_name = $profile_name - #else - #set object_type = '' - #set object_name = '' - #end if - #set breed = $getVar('breed','') - #set srv = $getVar('http_server','') - #set run_install_triggers = $getVar('run_install_triggers','') - #set runpre = "" - #if $object_type != '' - ## RUN PRE TRIGGER - #if $run_install_triggers - #if $breed == 'redhat' or $breed == 'suse' - #set runpre = "\ncurl \"http://%s/cblr/svc/op/trig/mode/pre/%s/%s\" -o /dev/null" % (srv, object_type, object_name) - #else - #set runpre = "\nwget \"http://%s/cblr/svc/op/trig/mode/pre/%s/%s\" -O /dev/null" % (srv, object_type, object_name) - #end if - #end if - #end if - #echo $runpre diff --git a/_includes/example-preseed-excerpt.txt b/_includes/example-preseed-excerpt.txt new file mode 100644 index 00000000..89e1f1cc --- /dev/null +++ b/_includes/example-preseed-excerpt.txt @@ -0,0 +1,42 @@ +### Apt setup +# Choose, if you want to scan additional installation media +# (default: false). +d-i apt-setup/cdrom/set-first boolean false +# You can choose to install non-free firmware. +#d-i apt-setup/non-free-firmware boolean true +# You can choose to install non-free and contrib software. +#d-i apt-setup/non-free boolean true +#d-i apt-setup/contrib boolean true +# Uncomment the following line, if you don't want to have the sources.list +# entry for a DVD/BD installation image active in the installed system +# (entries for netinst or CD images will be disabled anyway, regardless of +# this setting). +#d-i apt-setup/disable-cdrom-entries boolean true +# Uncomment this if you don't want to use a network mirror. +#d-i apt-setup/use_mirror boolean false +# Select which update services to use; define the mirrors to be used. +# Values shown below are the normal defaults. +#d-i apt-setup/services-select multiselect security, updates +#d-i apt-setup/security_host string security.debian.org + +# Additional repositories, local[0-9] available +#d-i apt-setup/local0/repository string \ +# http://local.server/debian stable main +#d-i apt-setup/local0/comment string local server +# Enable deb-src lines +#d-i apt-setup/local0/source boolean true +# URL to the public key of the local repository; you must provide a key or +# apt will complain about the unauthenticated repository and so the +# sources.list line will be left commented out. +#d-i apt-setup/local0/key string http://local.server/key +# or one can provide it in-line by base64 encoding the contents of the +# key file (with `base64 -w0`) and specifying it thus: +#d-i apt-setup/local0/key string base64://LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCi4uLgo= +# The content of the key file is checked to see if it appears to be ASCII-armoured. +# If so it will be saved with an ".asc" extension, otherwise it gets a '.gpg' extension. +# "keybox database" format is currently not supported. (see generators/60local in apt-setup's source) + +# By default the installer requires that repositories be authenticated +# using a known gpg key. This setting can be used to disable that +# authentication. Warning: Insecure, not recommended. +#d-i debian-installer/allow_unauthenticated boolean true diff --git a/_includes/example-preseed-excerpt.txt.md b/_includes/example-preseed-excerpt.txt.md deleted file mode 100644 index be463edc..00000000 --- a/_includes/example-preseed-excerpt.txt.md +++ /dev/null @@ -1,42 +0,0 @@ - ### Apt setup - # Choose, if you want to scan additional installation media - # (default: false). - d-i apt-setup/cdrom/set-first boolean false - # You can choose to install non-free firmware. - #d-i apt-setup/non-free-firmware boolean true - # You can choose to install non-free and contrib software. - #d-i apt-setup/non-free boolean true - #d-i apt-setup/contrib boolean true - # Uncomment the following line, if you don't want to have the sources.list - # entry for a DVD/BD installation image active in the installed system - # (entries for netinst or CD images will be disabled anyway, regardless of - # this setting). - #d-i apt-setup/disable-cdrom-entries boolean true - # Uncomment this if you don't want to use a network mirror. - #d-i apt-setup/use_mirror boolean false - # Select which update services to use; define the mirrors to be used. - # Values shown below are the normal defaults. - #d-i apt-setup/services-select multiselect security, updates - #d-i apt-setup/security_host string security.debian.org - - # Additional repositories, local[0-9] available - #d-i apt-setup/local0/repository string \ - # http://local.server/debian stable main - #d-i apt-setup/local0/comment string local server - # Enable deb-src lines - #d-i apt-setup/local0/source boolean true - # URL to the public key of the local repository; you must provide a key or - # apt will complain about the unauthenticated repository and so the - # sources.list line will be left commented out. - #d-i apt-setup/local0/key string http://local.server/key - # or one can provide it in-line by base64 encoding the contents of the - # key file (with `base64 -w0`) and specifying it thus: - #d-i apt-setup/local0/key string base64://LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCi4uLgo= - # The content of the key file is checked to see if it appears to be ASCII-armoured. - # If so it will be saved with an ".asc" extension, otherwise it gets a '.gpg' extension. - # "keybox database" format is currently not supported. (see generators/60local in apt-setup's source) - - # By default the installer requires that repositories be authenticated - # using a known gpg key. This setting can be used to disable that - # authentication. Warning: Insecure, not recommended. - #d-i debian-installer/allow_unauthenticated boolean true diff --git a/_includes/suse-15.6-autoyast.xml b/_includes/suse-15.6-autoyast.xml new file mode 100644 index 00000000..8804c8ed --- /dev/null +++ b/_includes/suse-15.6-autoyast.xml @@ -0,0 +1,121 @@ + + + + + false + + ## without the next 6 lines autoyast will ask for confirmation bevore installation + + + false + true + + + $SNIPPET('addons.xml') + $SNIPPET('hosts.xml') + + auto + + +
us.pool.ntp.org
+ false + false +
+ +
2.opensuse.pool.ntp.org
+ false + false +
+
+ 15 +
+ $SNIPPET('kdump.xml') + + us + + + en_US + + + + UTC + EST5EDT + + + + chrony + sudo + openssh + + + + + + sshd + + + + + $SNIPPET('suse-15.6-networking.xml') + + + true + root + 0 + /root + + + + + + + + + /bin/bash + 0 + $default_password_crypted + root + + + true + suse + $default_password_crypted + + + + ## we have to include the pre-scripts tag to get autoinstall_start included + + #set global $wrappedscript = 'autoinstall_start' + $SNIPPET('suse-15.6_scriptwrapper.xml') + ## SuSE has an annoying habit on ppc64 of changing the system + ## boot order after installation. This makes it non-trivial to + ## automatically re-install future OS. + #set global $wrappedscript = 'save_boot_device' + $SNIPPET('suse-15.6_scriptwrapper.xml') + + + ## + ## This plugin wrapper provides the flexibility to call pure shell + ## snippets which can be used directly on autoinst file and with + ## wrapper on SuSE. + ## + ## To use it + ## - exchange name_of_pure_shell_snippet with the name of this shell snippet + ## - and remove the '##' in front of the line with suse-15.6_scriptwrapper.xml + ## + #set global $wrappedscript = 'name_of_pure_shell_snippet' + ## $SNIPPET('suse-15.6_scriptwrapper.xml') + + ## SuSE has an annoying habit on ppc64 of changing the system + ## boot order after installation. This makes it non-trivial to + ## automatically re-install future OS. + #set global $wrappedscript = 'restore_boot_device' + $SNIPPET('suse-15.6_scriptwrapper.xml') + + ## we have to include the init-scripts tag to get autoinstall_done included + + #set global $wrappedscript = 'autoinstall_done' + $SNIPPET('suse-15.6_scriptwrapper.xml') + + +
diff --git a/_includes/suse-15.6-autoyast.xml.md b/_includes/suse-15.6-autoyast.xml.md deleted file mode 100644 index bbfea9f0..00000000 --- a/_includes/suse-15.6-autoyast.xml.md +++ /dev/null @@ -1,121 +0,0 @@ - - - - - false - - ## without the next 6 lines autoyast will ask for confirmation bevore installation - - - false - true - - - $SNIPPET('addons.xml') - $SNIPPET('hosts.xml') - - auto - - -
us.pool.ntp.org
- false - false -
- -
2.opensuse.pool.ntp.org
- false - false -
-
- 15 -
- $SNIPPET('kdump.xml') - - us - - - en_US - - - - UTC - EST5EDT - - - - chrony - sudo - openssh - - - - - - sshd - - - - - $SNIPPET('suse-15.4-networking.xml') - - - true - root - 0 - /root - - - - - - - - - /bin/bash - 0 - $default_password_crypted - root - - - true - suse - $default_password_crypted - - - - ## we have to include the pre-scripts tag to get autoinstall_start included - - #set global $wrappedscript = 'autoinstall_start' - $SNIPPET('suse-15.4_scriptwrapper.xml') - ## SuSE has an annoying habit on ppc64 of changing the system - ## boot order after installation. This makes it non-trivial to - ## automatically re-install future OS. - #set global $wrappedscript = 'save_boot_device' - $SNIPPET('suse-15.4_scriptwrapper.xml') - - - ## - ## This plugin wrapper provides the flexibility to call pure shell - ## snippets which can be used directly on autoinst file and with - ## wrapper on SuSE. - ## - ## To use it - ## - exchange name_of_pure_shell_snippet with the name of this shell snippet - ## - and remove the '##' in front of the line with suse-15.4_scriptwrapper.xml - ## - #set global $wrappedscript = 'name_of_pure_shell_snippet' - ## $SNIPPET('suse-15.4_scriptwrapper.xml') - - ## SuSE has an annoying habit on ppc64 of changing the system - ## boot order after installation. This makes it non-trivial to - ## automatically re-install future OS. - #set global $wrappedscript = 'restore_boot_device' - $SNIPPET('suse-15.4_scriptwrapper.xml') - - ## we have to include the init-scripts tag to get autoinstall_done included - - #set global $wrappedscript = 'autoinstall_done' - $SNIPPET('suse-15.4_scriptwrapper.xml') - - -
diff --git a/_includes/suse-15.6-networking.xml b/_includes/suse-15.6-networking.xml new file mode 100644 index 00000000..703bfd64 --- /dev/null +++ b/_includes/suse-15.6-networking.xml @@ -0,0 +1,234 @@ +#set $osversion = $getVar("os_version","") +#set $hostname = $getVar("hostname","") +#if $hostname == "" +#set $hostname = $getVar("system_name","cobbler") +#end if +#if $getVar("dns_name_eth0","") != "" + #set $my_hostname = $hostname.split('.',1)[:1][0] + #set $my_domainname = $dns_name_eth0.split('.',1)[1:][0] +#else + #set $my_hostname = $hostname + #set $my_domainname = "site" +#end if + + +## Figure out if we're automating OS installation for a system or a profile +#if $getVar('system_name','') != '' + false +#else + true +#end if + + + + + + false + false + + $my_hostname + $my_domainname + #if $getVar("name_servers_search",[]) != [] + + #for $sd in $name_servers_search + $sd + #end for + + #end if + #if $name_servers and $name_servers[0] != "": + + #for $ns in $name_servers + $ns + #end for + + #end if + + + #if $getVar("system_name","") != "" + #import re + #set $vlanpattern = $re.compile("[a-zA-Z0-9]+[\.][0-9]+") + #set $ikeys = $interfaces.keys() + #for $iface in $ikeys + #set $idata = $interfaces[$iface] + #set $mac = $idata.get("mac_address", "").lower() + #set $static = $idata.get("static", "") + #set $ip = $idata.get("ip_address", "") + #set $netmask = $idata.get("netmask", "") + #set $static_routes = $idata.get("static_routes", "") + #set $iface_type = $idata.get("interface_type", "").lower() + #set $iface_master = $idata.get("interface_master", "") + #set $bonding_opts = $idata.get("bonding_opts", "").lower() + #set $ipv6_address = $idata.get("ipv6_address", "") + #set $ipv6_secondaries = $idata.get("ipv6_secondaries", "") + #set $ipv6_mtu = $idata.get("ipv6_mtu", "") + #set $ipv6_default_gateway = $idata.get("ipv6_default_gateway", "") + #set $ipv6_static_routes = $idata.get("ipv6_static_routes", "") + ## start of interface section + + #if $iface_type in ("bond", "master") + yes + $bonding_opts + #set $loop_ikeys = $interfaces.keys() + #set $loop_counter = 0 + #for $loop_iface in $loop_ikeys + #set $loop_idata = $interfaces[$loop_iface] + #set $loop_interface_type = $loop_idata.get("interface_type", "").lower() + #if $loop_interface_type in ("slave","bond_slave") + #if $loop_idata["interface_master"] != "" + #if $loop_idata["interface_master"].lower() == $iface.lower() + $loop_iface + #set $loop_counter += 1 + #end if + #end if + #end if + #end for + #if $static + static + #else + dhcp + #end if + $iface + $ip + $netmask + auto + no + #elif $iface_type in ("slave","bond_slave","bridge_slave") + none + $iface + #if $osversion == "sles12" or re.match('^sles12sp[1234]$', $osversion) + hotplug + #else + off + #end if + no + #elif $iface_type in ("","na") + #if $static + static + #else + dhcp + #end if + $iface + $mac + $ip + $netmask + auto + no + #end if + ## =================================================================== + ## VLAN configuration + ## =================================================================== + #if $vlanpattern.match($iface) + #set [$etherdevice, $vlanid] = $iface.split(".") + $etherdevice + $vlanid + #end if + ## =================================================================== + ## IPv6 support + ## =================================================================== + #if $ipv6_address != "" + + + $ipv6_address + + 64 + + #if $ipv6_secondaries != "" + #set $s = 1 + #for $alias in $ipv6_secondaries + + $alias + + 64 + + #set $s += 1 + #end for + #end if + + #end if + + #end for + #end if + + network_manager + #if $getVar("system_name","") != "" + + #set $ikeys = $interfaces.keys() + #for $iface in $ikeys + #set $idata = $interfaces[$iface] + #set $mac = $idata["mac_address"] + #set $interface_type = $idata["interface_type"] + #if $mac.lower() != "" + #if $interface_type.lower() not in ["bond","bridge"] + + $iface + ATTR{address} + $mac.lower() + + #end if + #end if + #end for + + #end if + + false + #if $getVar("system_name","") != "" + + + default + - + - + $gateway + + ## =================================================================== + ## IPv4 static route setup + ## =================================================================== + #for $iface in $ikeys + #set $idata = $interfaces[$iface] + #set $static_routes = $idata.get("static_routes", "") + #for $route in $static_routes + #set routepattern = $re.compile("[0-9/.]+:[0-9.]+") + #if $routepattern.match($route) + #set $routebits = $route.split(":") + #set [$network, $router] = $route.split(":") + + $network + - + $iface + $router + + #end if + #end for + #end for + ## =================================================================== + ## IPv6 routing setup + ## =================================================================== + #for $iface in $ikeys + #set $idata = $interfaces[$iface] + #set $ipv6_static_routes = $idata.get("ipv6_static_routes", "") + #set $ipv6_default_gateway = $idata.get("ipv6_default_gateway", "") + #if $ipv6_default_gateway != "" + + default + - + $iface + $ipv6_default_gateway + + #end if + #for $route in $ipv6_static_routes + #set routepattern = $re.compile("[0-9a-fA-F:/]+,[0-9a-fA-F:]+") + #if $routepattern.match($route) + #set $routebits = $route.split(",") + #set [$network, $router] = $route.split(",") + + $network + - + $iface + $router + + #end if + #end for + #end for + + #end if + + diff --git a/_includes/suse-15.6-networking.xml.md b/_includes/suse-15.6-networking.xml.md deleted file mode 100644 index 0d7ba616..00000000 --- a/_includes/suse-15.6-networking.xml.md +++ /dev/null @@ -1,234 +0,0 @@ - #set $osversion = $getVar("os_version","") - #set $hostname = $getVar("hostname","") - #if $hostname == "" - #set $hostname = $getVar("system_name","cobbler") - #end if - #if $getVar("dns_name_eth0","") != "" - #set $my_hostname = $hostname.split('.',1)[:1][0] - #set $my_domainname = $dns_name_eth0.split('.',1)[1:][0] - #else - #set $my_hostname = $hostname - #set $my_domainname = "site" - #end if - - - ## Figure out if we're automating OS installation for a system or a profile - #if $getVar('system_name','') != '' - false - #else - true - #end if - - - - - - false - false - - $my_hostname - $my_domainname - #if $getVar("name_servers_search",[]) != [] - - #for $sd in $name_servers_search - $sd - #end for - - #end if - #if $name_servers and $name_servers[0] != "": - - #for $ns in $name_servers - $ns - #end for - - #end if - - - #if $getVar("system_name","") != "" - #import re - #set $vlanpattern = $re.compile("[a-zA-Z0-9]+[\.][0-9]+") - #set $ikeys = $interfaces.keys() - #for $iface in $ikeys - #set $idata = $interfaces[$iface] - #set $mac = $idata.get("mac_address", "").lower() - #set $static = $idata.get("static", "") - #set $ip = $idata.get("ip_address", "") - #set $netmask = $idata.get("netmask", "") - #set $static_routes = $idata.get("static_routes", "") - #set $iface_type = $idata.get("interface_type", "").lower() - #set $iface_master = $idata.get("interface_master", "") - #set $bonding_opts = $idata.get("bonding_opts", "").lower() - #set $ipv6_address = $idata.get("ipv6_address", "") - #set $ipv6_secondaries = $idata.get("ipv6_secondaries", "") - #set $ipv6_mtu = $idata.get("ipv6_mtu", "") - #set $ipv6_default_gateway = $idata.get("ipv6_default_gateway", "") - #set $ipv6_static_routes = $idata.get("ipv6_static_routes", "") - ## start of interface section - - #if $iface_type in ("bond", "master") - yes - $bonding_opts - #set $loop_ikeys = $interfaces.keys() - #set $loop_counter = 0 - #for $loop_iface in $loop_ikeys - #set $loop_idata = $interfaces[$loop_iface] - #set $loop_interface_type = $loop_idata.get("interface_type", "").lower() - #if $loop_interface_type in ("slave","bond_slave") - #if $loop_idata["interface_master"] != "" - #if $loop_idata["interface_master"].lower() == $iface.lower() - $loop_iface - #set $loop_counter += 1 - #end if - #end if - #end if - #end for - #if $static - static - #else - dhcp - #end if - $iface - $ip - $netmask - auto - no - #elif $iface_type in ("slave","bond_slave","bridge_slave") - none - $iface - #if $osversion == "sles12" or re.match('^sles12sp[1234]$', $osversion) - hotplug - #else - off - #end if - no - #elif $iface_type in ("","na") - #if $static - static - #else - dhcp - #end if - $iface - $mac - $ip - $netmask - auto - no - #end if - ## =================================================================== - ## VLAN configuration - ## =================================================================== - #if $vlanpattern.match($iface) - #set [$etherdevice, $vlanid] = $iface.split(".") - $etherdevice - $vlanid - #end if - ## =================================================================== - ## IPv6 support - ## =================================================================== - #if $ipv6_address != "" - - - $ipv6_address - - 64 - - #if $ipv6_secondaries != "" - #set $s = 1 - #for $alias in $ipv6_secondaries - - $alias - - 64 - - #set $s += 1 - #end for - #end if - - #end if - - #end for - #end if - - network_manager - #if $getVar("system_name","") != "" - - #set $ikeys = $interfaces.keys() - #for $iface in $ikeys - #set $idata = $interfaces[$iface] - #set $mac = $idata["mac_address"] - #set $interface_type = $idata["interface_type"] - #if $mac.lower() != "" - #if $interface_type.lower() not in ["bond","bridge"] - - $iface - ATTR{address} - $mac.lower() - - #end if - #end if - #end for - - #end if - - false - #if $getVar("system_name","") != "" - - - default - - - - - $gateway - - ## =================================================================== - ## IPv4 static route setup - ## =================================================================== - #for $iface in $ikeys - #set $idata = $interfaces[$iface] - #set $static_routes = $idata.get("static_routes", "") - #for $route in $static_routes - #set routepattern = $re.compile("[0-9/.]+:[0-9.]+") - #if $routepattern.match($route) - #set $routebits = $route.split(":") - #set [$network, $router] = $route.split(":") - - $network - - - $iface - $router - - #end if - #end for - #end for - ## =================================================================== - ## IPv6 routing setup - ## =================================================================== - #for $iface in $ikeys - #set $idata = $interfaces[$iface] - #set $ipv6_static_routes = $idata.get("ipv6_static_routes", "") - #set $ipv6_default_gateway = $idata.get("ipv6_default_gateway", "") - #if $ipv6_default_gateway != "" - - default - - - $iface - $ipv6_default_gateway - - #end if - #for $route in $ipv6_static_routes - #set routepattern = $re.compile("[0-9a-fA-F:/]+,[0-9a-fA-F:]+") - #if $routepattern.match($route) - #set $routebits = $route.split(",") - #set [$network, $router] = $route.split(",") - - $network - - - $iface - $router - - #end if - #end for - #end for - - #end if - - diff --git a/_includes/suse-15.6_scriptwrapper.xml b/_includes/suse-15.6_scriptwrapper.xml new file mode 100644 index 00000000..87d15c1a --- /dev/null +++ b/_includes/suse-15.6_scriptwrapper.xml @@ -0,0 +1,10 @@ + diff --git a/_includes/suse-15.6_scriptwrapper.xml.md b/_includes/suse-15.6_scriptwrapper.xml.md deleted file mode 100644 index e20a732b..00000000 --- a/_includes/suse-15.6_scriptwrapper.xml.md +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/_posts/2024/2024-12-02-Cobbler-v3.3.7-Debian-Deployment-Guide.md b/_posts/2024/2024-12-02-Cobbler-v3.3.7-Debian-Deployment-Guide.md index 1b95b827..da6a2587 100644 --- a/_posts/2024/2024-12-02-Cobbler-v3.3.7-Debian-Deployment-Guide.md +++ b/_posts/2024/2024-12-02-Cobbler-v3.3.7-Debian-Deployment-Guide.md @@ -301,7 +301,11 @@ Now the **PXE Client** should be able to boot from a generic/random MAC address - The issue stems from the below section of the preseed file, retrieved drectly from Debian's official [stable](https://www.debian.org/releases/stable/example-preseed.txt) and [bookworm](https://www.debian.org/releases/bookworm/example-preseed.txt) example preseed files. -{% include example-preseed-excerpt.txt.md path="_includes/example-preseed-excerpt.txt.md" %} +{% capture file %}```shell +{% include example-preseed-excerpt.txt path="_includes/example-preseed-excerpt.txt" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %} - As seen in the procedures above, `allow_unauthenticated` is set to true, which appears to only permit the installation to START when an untrusted repo mirror is found, but the mirror will be checked again before beginning the `apt-setup` phase, which `allow_unauthenticated` will not override. diff --git a/_posts/2025/2025-02-05-Cobbler-v3.3.7-OpenSUSE-Deployment-Guide.md b/_posts/2025/2025-02-05-Cobbler-v3.3.7-OpenSUSE-Deployment-Guide.md index 05a0d157..b13e7ddf 100644 --- a/_posts/2025/2025-02-05-Cobbler-v3.3.7-OpenSUSE-Deployment-Guide.md +++ b/_posts/2025/2025-02-05-Cobbler-v3.3.7-OpenSUSE-Deployment-Guide.md @@ -101,18 +101,15 @@ Configure the Cobbler Profile to use the new autoinstall (`autoyast.xml`) templa cobbler profile edit --name SUSE-15.6-x86_64 --autoinstall suse-15.6-autoyast.xml ``` -Create a new Cobbler System to automatically boot and install openSUSE Leap 15.6, replacing the *"aa:bb:cc:dd:ee:ff"* with the MAC address of your PXE client, being sure not to use a duplicate MAC or IP addresse of any other Cobbler System, and then sync up Cobbler: +Finally, create a new Cobbler System to automatically boot and install openSUSE Leap 15.6, replacing the *"aa:bb:cc:dd:ee:ff"* with the MAC address of your PXE client, being sure not to use a duplicate MAC or IP addresse of any other Cobbler System, and then sync up Cobbler, then sync up cobbler: ```shell cobbler system add --name SUSE-15.6 --profile SUSE-15.6-x86_64 --netboot-enabled true --hostname SUSE-15-6 --interface eth0 --static true --mac-address "aa:bb:cc:dd:ee:ff" --ip-address 10.0.0.15 --gateway 10.0.0.1 --netmask 255.255.255.0 --name-servers "10.0.0.1 1.1.1.1 10.0.0.10" -``` - -Finally, sync up Cobbler: - -```shell cobbler sync ``` +The **PXE Client** VM can now be powered on, and should automatically boot to PXE and install openSUSE Leap 15.6 to the VM HDD using the "suse-15.6-autoyast.xml" autoyast template created above. + ## Taking it Further (Leap Micro Deployment) With openSUSE Leap 15 deploying successfully as described above, the Cobbler server is also prepped to deploy openSUSE Leap Micro *(v5.5 tested)* @@ -171,22 +168,42 @@ cobbler sync 1. Edited files - - suse-15.6-autoyast.xml + - `/var/lib/cobbler/templates/suse-15.6-autoyast.xml` -{% include suse-15.6-autoyast.xml.md path="_includes/suse-15.6-autoyast.xml.md" %} +{% capture file %}```xml +{% include suse-15.6-autoyast.xml path="_includes/suse-15.6-autoyast.xml" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %} - - suse-15.6-networking.xml + - `/var/lib/cobbler/snippets/suse-15.6-networking.xml` -{% include suse-15.6-networking.xml.md path="_includes/suse-15.6-networking.xml.md" %} +{% capture file %}```xml +{% include suse-15.6-networking.xml path="_includes/suse-15.6-networking.xml" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %} - - suse-15.6_scriptwrapper.xml + - `/var/lib/cobbler/snippets/suse-15.6_scriptwrapper.xml` -{% include suse-15.6_scriptwrapper.xml.md path="_includes/suse-15.6_scriptwrapper.xml.md" %} +{% capture file %}```xml +{% include suse-15.6_scriptwrapper.xml path="_includes/suse-15.6_scriptwrapper.xml" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %} - - autoinstall_start + - `/var/lib/cobbler/snippets/autoinstall_start` -{% include autoinstall_start.md path="_includes/autoinstall_start.md" %} +{% capture file %}```shell +{% include autoinstall_start path="_includes/autoinstall_start" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %} - - autoinstall_done + - `/var/lib/cobbler/snippets/autoinstall_done` -{% include autoinstall_done.md path="_includes/autoinstall_done.md" %} +{% capture file %}```shell +{% include autoinstall_done path="_includes/autoinstall_done" %}```{% endcapture %} +{% assign lines = file | newline_to_br | strip_newlines | split: "
" %} +{% for line in lines %}{{ line | prepend: " " }} +{% endfor %}