4

I am really curious about when the minion id loads?

http://docs.saltstack.com/en/latest/ref/configuration/minion.html#std:conf_minion-id

Here, it says that the minion id is the system's default hostname.

When does this value get loaded up? Everytime it starts or everytime a change to the system hostname is detected?

What happens if someone comes along and changes the hostname by hand without informing other people which have access to that minion? Does it reload automatically or what?

tshepang
  • 12,111
  • 21
  • 91
  • 136
tudoricc
  • 709
  • 1
  • 12
  • 31

2 Answers2

4

Here's what documentation has to say regarding ID generation of minion.

I have tried it my self. I was using ubuntu ec2 instance.

  • The first time you run the minion it uses FQDN to set the id of the instance, so whatever result of hostname --fqdn was there when minion first started that becomes the ID.
  • Subsequent restart the ID does not change even if you change the hostname.
  • If you want to change the ID you need to change it manually in minion config

file.

bitkot
  • 4,466
  • 2
  • 28
  • 39
  • I found something relevant to this too,apparently the master caches a minion's ID: `minion_id_caching=True`,the default value,so that might be one of the reasons the second bullet happens. – tudoricc Jul 31 '15 at 09:17
  • I couldn't find any documentation regarding that attribute. But because this is set on master I don't think it has anything to do with minion id change. This would just mean that does master allow same minion with a changed id to connect. – bitkot Jul 31 '15 at 09:47
  • https://github.com/saltstack/salt/issues/7558 scroll down a little bit,the post before the last one mentions it – tudoricc Jul 31 '15 at 11:05
3

You can change current minion id in /etc/salt/minion_id.

When I use a Docker container, I usually add hostname > /etc/salt/minion_id to docker-entrypoint.sh or to the Dockerfile. If you do that, remember to start salt-minion after changing the minion_id (not before).

ilykos
  • 345
  • 2
  • 6