How to add a new host (salt era)
This example will use
as a sample machine which before was known as
. Before you begin, you need to have ssh-agent forwarding enabled to automatically commit/push to the various repos involved.
Steps to perform:
All of this is done on our central salt master machine:
- Create a set of ssh hostkeys, e.g. by running
/srv/salt/bin/salt_add_ssh_hostkeys einstein12followed by running
- Add host under
/srv/salt/hosts/hosts.de.g. in this case
/srv/salt/hosts/hosts.d/einstein.hostse.g. in this case
10.20.80.12 einstein12.atlas.local einstein12
172.17.0.12 mgeinstein12.atlas.local mgeinstein12
172.17.1.12 ipeinstein12.atlas.local ipeinstein12
- Commit these changes and push upstream, e.g.
git add einstein.hosts
git commit -m "Add einstein12 to DNS" einstein.hosts
git pushThe actual
/etc/hosts will be auto-created via a git hook and this change will be also automatically propagated to
condormaster via a hooked salt state.apply
- Check if the new host is already part of the appropriate nodegroups (
/srv/salt/master.d/nodegroups.conf) and if the appropriate states are defined as the machine will run a salt highstate upon first reboot. Changes to
nodegroups.conf or salt's
top.sls may require a reload/restart of the salt-master process.
All of this is done on our FAI server
- Add/change MAC address to IP mapping under
/etc/dhcp. In this case
ra15 was the progenitor of
einstein12, hence the old entries for ra15 needed to be moved from
- Committing the changes will automatically trigger a DHCP server restart
git commit -am "Rename ra15 to einstein12"
- Check configuration under
/srv/fai/config if it is suitable for the base installation. Usually, this involves checking if the appropriate classes are set (
class/50-host-classes) and depending on hostname/classes files under
- Tell FAI to install the machine upon next reboot by running
/usr/local/bin/fai-boot-generic.sh -v einstein12Please note that you need to automatically log into our salt server for this to work, e.g. you need to have ssh-agent forwarding enabled.
- 26 Oct 2016