Skip to content

Commit ad0e167

Browse files
authored
Merge pull request #193 from sus-admin/3.3.7-Ubuntu-deployment-guide
3.3.7 ubuntu deployment guide
2 parents c22aa34 + af629bd commit ad0e167

9 files changed

+477
-3
lines changed

_includes/cloud-init_hostname.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#if $getVar("system_name","") != ""
2+
#if $hostname != ""
3+
hostname: $hostname
4+
#else
5+
#set $myhostname = $getVar('name','').replace("_","-")
6+
hostname: $myhostname
7+
#end if
8+
#else
9+
## profile based install so just provide one interface for starters
10+
#set $myhostname = $getVar('hostname',$getVar('name','cobbler')).replace("_","-")
11+
hostname: $myhostname
12+
#end if

_includes/cloud-init_network.txt

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#if $getVar("system_name","") != ""
2+
network:
3+
ethernets:
4+
#set ikeys = $interfaces.keys()
5+
#import re
6+
#for $iname in $ikeys
7+
#set $idata = $interfaces[$iname]
8+
## Ignore BMC interface
9+
#if $idata["interface_type"].lower() == "bmc"
10+
#continue
11+
#end if
12+
#end for
13+
#for $iname in $ikeys
14+
#set $idata = $interfaces[$iname]
15+
#set $mac = $idata["mac_address"]
16+
#set $static = $idata["static"]
17+
#set $ip = $idata["ip_address"]
18+
#set $netmask = $idata["netmask"]
19+
#set $type = $idata["interface_type"]
20+
## Ignore BMC interface
21+
#if $type == "bmc"
22+
#continue
23+
#end if
24+
$iname:
25+
match:
26+
macaddress: $mac
27+
#if $static == True:
28+
#if $ip != "":
29+
#if $netmask != "":
30+
#set $mask = sum([bin(int(x)).count('1') for x in $netmask.split('.')])
31+
dhcp4: false
32+
addresses:
33+
- $ip/$mask
34+
#else
35+
dhcp4: false
36+
addresses:
37+
- $ip/24
38+
#end if
39+
#if $gateway != "":
40+
gateway4: $gateway
41+
#end if
42+
#if $name_servers and $name_servers[0] != "":
43+
nameservers:
44+
addresses:
45+
#for $dns in $name_servers
46+
- $dns
47+
#end for
48+
#end if
49+
#else
50+
dhcp4: true
51+
#end if
52+
#else
53+
dhcp4: true
54+
#end if
55+
#end for
56+
version: 2
57+
#else
58+
## profile based install so use DHCP
59+
network:
60+
ethernets:
61+
eth0:
62+
dhcp4: true
63+
version: 2
64+
#end if

_includes/cloud-init_user-data.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#cloud-config
2+
autoinstall:
3+
version: 1
4+
apt:
5+
preserve_sources_list: true
6+
primary:
7+
- arches: [amd64, i386]
8+
uri: http://$http_server/cblr/links/$distro
9+
## uri: http://us.archive.ubuntu.com/ubuntu
10+
- arches: [default]
11+
## uri: http://$http_server/cblr/links/$distro
12+
uri: http://ports.ubuntu.com/ubuntu-ports
13+
fallback: offline-install
14+
identity:
15+
$SNIPPET('cloud-init_hostname')
16+
password: $default_password_crypted
17+
realname: ubuntu
18+
username: ubuntu
19+
kernel:
20+
package: linux-generic
21+
keyboard:
22+
layout: us
23+
toggle: null
24+
variant: ''
25+
locale: en_US.UTF-8
26+
$SNIPPET('cloud-init_network')
27+
ssh:
28+
allow-pw: true
29+
install-server: true
30+
storage:
31+
layout:
32+
name: lvm
33+
sizing-policy: all
34+
package_update: false
35+
package_upgrade: false
36+
late-commands:
37+
## Figure out if we're automating OS installation for a system or a profile
38+
#if $getVar('system_name','') != ''
39+
#set $what = "system"
40+
#else
41+
#set $what = "profile"
42+
#end if
43+
- wget -O /target/tmp/autoinstall-user-data.yaml http://$http_server/cblr/svc/op/autoinstall/$what/$name
44+
- chroot /target /bin/bash -s ssh-keygen -t rsa -b 2048 -m ssh2 -N "" -f /root/.ssh/id_rsa
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
for PROFILE in $(cobbler profile list); do
3+
DIST=$(cobbler profile report --name $PROFILE | grep ^Distribution | awk {' print $3 '});
4+
VER=$(cobbler distro report --name $DIST | grep "OS Version" | awk {' print $4 '});
5+
[[ ($VER == "focal" || $VER == "jammy" || $VER == "noble") ]] || continue;
6+
sed -i "s,auto-install/enable=true priority=critical netcfg/choose_interface=auto url=http://10.0.0.10/cblr/svc/op/autoinstall/profile/${PROFILE} hostname=.* domain=local.lan suite=${VER},," /var/lib/tftpboot/grub/x86_64_menu_items.cfg;
7+
sed -i "s,auto-install/enable=true priority=critical netcfg/choose_interface=auto url=http://10.0.0.10/cblr/svc/op/autoinstall/profile/${PROFILE} hostname=.* domain=local.lan suite=${VER},," /var/lib/tftpboot/pxelinux.cfg/default;
8+
DIST="" && VER="";
9+
done
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
for SYSTEM in $(cobbler system list); do
3+
PROFILE=$(cobbler system report --name $SYSTEM | grep ^Profile | awk {' print $3 '})
4+
DIST=$(cobbler profile report --name $PROFILE | grep ^Distribution | awk {' print $3 '});
5+
VER=$(cobbler distro report --name $DIST | grep "OS Version" | awk {' print $4 '});
6+
[[ ($VER == "focal" || $VER == "jammy" || $VER == "noble") ]] || continue;
7+
MAC=$(cobbler system report --name $SYSTEM | grep "MAC Addr" | awk {' print $4 '})
8+
sed -i "s,auto-install/enable=true priority=critical netcfg/choose_interface=auto url=http://10.0.0.10/cblr/svc/op/autoinstall/system/${SYSTEM} hostname=.* domain=local.lan suite=${VER},," /var/lib/tftpboot/grub/system/$MAC;
9+
MAC=$(echo $MAC | sed 's,:,-,g');
10+
sed -i "s,auto-install/enable=true priority=critical netcfg/choose_interface=auto url=http://10.0.0.10/cblr/svc/op/autoinstall/profile/${PROFILE} hostname=.* domain=local.lan suite=${VER},," /var/lib/tftpboot/pxelinux.cfg/01-$MAC;
11+
PROFILE="" && DIST="" && VER="" && MAC="";
12+
done

_posts/2024/2024-11-12-Cobbler-v3.3.6-Beginners-Guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Install **VirtualBox VM Guest Additions**, either from the YUM repos, or the Gue
106106
yum install virtualbox-guest-additions
107107
```
108108

109-
### customizing
109+
### Customizing
110110

111111
Install your preferred Linux sys admin tools and configure some convenient bash settings, for example *(PS1 variable controls bash shell prompt)*:
112112

@@ -573,3 +573,4 @@ tftp 127.0.0.1
573573
cat /etc/httpd/conf/httpd.conf
574574
cat /etc/httpd/conf.d/cobbler.conf
575575
```
576+

_posts/2024/2024-12-02-Cobbler-v3.3.7-Debian-Deployment-Guide.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ Now the **PXE Client** should be able to boot from a generic/random MAC address
332332
- [https://www.debian.org/distrib/netinst](https://www.debian.org/distrib/netinst)
333333
- [https://www.debian.org/distrib/netinst#netboot](https://www.debian.org/distrib/netinst#netboot)
334334
- [https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/MANIFEST](https://deb.debian.org/debian/dists/bookworm/main/installer-amd64/current/images/MANIFEST)
335-
- [https://wiki.debian.org/PXEBootInstall](https://wiki.debian.org/PXEBootInstall])
335+
- [https://wiki.debian.org/PXEBootInstall](https://wiki.debian.org/PXEBootInstall)
336336
- [https://wiki.debian.org/DebianInstaller](https://wiki.debian.org/DebianInstaller)
337337
- [https://wiki.debian.org/DebianInstaller/NetbootFirmware](https://wiki.debian.org/DebianInstaller/NetbootFirmware)
338338
- [https://wiki.debian.org/DebianInstaller/Preseed](https://wiki.debian.org/DebianInstaller/Preseed)
@@ -381,3 +381,4 @@ Now the **PXE Client** should be able to boot from a generic/random MAC address
381381
- [https://debian-handbook.info/browse/wheezy/sect.package-authentication.html](https://debian-handbook.info/browse/wheezy/sect.package-authentication.html)
382382
- [https://serverfault.com/questions/337278/debian-how-can-i-securely-get-debian-archive-keyring-so-that-i-can-do-an-apt-g](https://serverfault.com/questions/337278/debian-how-can-i-securely-get-debian-archive-keyring-so-that-i-can-do-an-apt-g)
383383
- [https://ubuntuforums.org/archive/index.php/t-2217665.html](https://ubuntuforums.org/archive/index.php/t-2217665.html)
384+

_posts/2025/2025-02-05-Cobbler-v3.3.7-OpenSUSE-Deployment-Guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Configure the Cobbler Profile to use the new autoinstall (`autoyast.xml`) templa
101101
cobbler profile edit --name SUSE-15.6-x86_64 --autoinstall suse-15.6-autoyast.xml
102102
```
103103

104-
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:
104+
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:
105105

106106
```shell
107107
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"

0 commit comments

Comments
 (0)