0

I run my salt-minion and salt-stack on a single machine with its hostname as HOSTNAME. When salt-minion's key get accepted by the salt-master service, it appends localdomain to the minion's hostname. So, it looks like this,

Accepted Keys:
sk-box.localdomain

I expect,

Accepted Keys:
sk-box

And when i try to bootstrap with the listed name using the command salt-run manage.bootstrap hosts='sk-box.localdomain', it throws error as,

ssh: Could not resolve hostname : Name or service not known
Madhavan
  • 123
  • 1
  • 7

1 Answers1

1

The one thing I configure on all my minions before bootstrapping salt is the minion id.

This problem is so common that Salt Stack added an option to Salt Bootstrap to set the minion id at install time:

-i Pass the salt-minion id. This will be stored under /etc/salt/minion_id

If you aren't using bootstrap.sh to install you can set the minion id in either of these files BEFORE starting or installing salt-minion:

  1. /etc/salt/minion.d/local.conf
  2. /etc/salt/minion_id

I then usually add states in the highstate run that configure /etc/resolv.conf, /etc/hostname, /etc/domainname, and /etc/hosts based on grains['id']

Dan Garthwaite
  • 2,922
  • 18
  • 29