Cobbler is a Linux installation server that helps you to automate Linux installations. In this tutorial, we will show you how to install Cobbler on nixOS Latest.
Open your terminal and switch to the sudo user account.
Update your system's package list using the following command:
sudo nix-channel --update
Install Cobbler and its dependencies by running:
sudo nix-env -iA nixos.cobbler
Cobbler requires the TFTP server, install it with:
sudo nix-env -iA nixos.tftp-hpa
Open the Cobbler configuration file located at /etc/cobbler/settings
and configure it to your needs. Here’s an example:
default_password_crypted: "$1$1234567890"
manage_dhcp: 1
system_password_crypted: "$1$1234567890"
Note: Don't forget to replace the "1234567890" strings with your preferred password hash.
Restart the cobbler daemon by running:
sudo systemctl restart cobblerd
To set up a DHCP server with Cobbler, we should edit the file /etc/cobbler/dhcp.template
in your favorite text editor. Here’s an example:
subnet 172.22.0.0 netmask 255.255.255.0 {
option routers 172.22.0.1;
option domain-name-servers 172.22.0.1;
option subnet-mask 255.255.255.0;
range dynamic-bootp 172.22.0.60 172.22.0.250;
default-lease-time 21600;
max-lease-time 43200;
next-server $next_server;
filename "$pxe_image_name";
}
Note: Replace "172.22.0.0", "172.22.0.1", "60", and "250" with your desired DHCP settings.
Make a backup of the current dhcp.conf file by running:
sudo cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak
Fix the ownership of the DHCP configuration file with cobbler by running:
sudo chown dhcpd:dhcpd /etc/cobbler/dhcp.template
Apply the new configuration by running:
sudo cobbler sync
sudo systemctl restart dhcpd
You have successfully installed and configured Cobbler on your nixOS Latest system. You can now use it to automate Linux installations.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!