Skip to content

Configuration

Open the tools container, which includes all the tools needed:

make tools
nix-develop

Note

It will take a while to build the tools container on the first time

Run the following script to configure the homelab:

make configure

Example

Text editor (nvim):
Enter seed repo (github.com/llajas/homelab): github.com/example/homelab
Enter your domain (lajas.tech): example.com

It will prompt you to edit the inventory:

  • IP address: the desired one, not the current one, since your servers have no operating system installed yet
  • Disk: based on /dev/$DISK, in my case it's sda, but yours can be sdb, nvme0n1...
  • Network interface: usually it's eth0, mine are eno1 and enp0s31f6. Note that this is not arbitrary and must match what the host sets during setup. You can either search for the chipset behind the ethernet adapter or do a test run while attached to a screen to see what the value eventually turns into. See the following StackExchange/ServerFault links for more clarity:
  • Ensuring that the adapter is set properly will allow the host to take on the proper IP address defint in the inventory, else a DHCP address will be taken and cause issues with cluster connectivity unless set with a reserved address on the DHCP Server.
  • MAC address: the lowercase, colon separated MAC address of the above network interface

Example

metal/inventories/prod.yml
metal:
  children:
    masters:
      hosts:
        metal0: {ansible_host: 10.137.0.10, mac: '00:23:24:ab:92:cb', disk: sda, network_interface: eno1}
        metal1: {ansible_host: 10.137.0.11, mac: '00:23:24:ab:8e:05', disk: sda, network_interface: eno1}
        metal2: {ansible_host: 10.137.0.12, mac: '00:23:24:ce:3a:53', disk: sda, network_interface: eno1}
        metal7: {ansible_host: 10.137.0.17, mac: '52:54:00:34:2a:c2', disk: sda, network_interface: enp12s0}
    workers:
      hosts:
        metal3: {ansible_host: 10.137.0.13, mac: '00:23:24:ab:99:b9', disk: sda, network_interface: eno1}
        metal4: {ansible_host: 10.137.0.14, mac: '6c:4b:90:3e:58:61', disk: sda, network_interface: enp0s31f6}
        metal5: {ansible_host: 10.137.0.15, mac: '6c:4b:90:6f:32:b1', disk: sda, network_interface: enp0s31f6}
        metal6: {ansible_host: 10.137.0.16, mac: 'd8:cb:8a:bf:d6:79', disk: vda, network_interface: ens2}

At the end it will show what has changed. After examining the diff, commit and push the changes.