1

I'm starting to play with Saltstack and I haven't found a way to display any runtime details of a salt minion. Specifically I wanted to display the salt master server(s) that a salt minion is currently utilizing.

It seems like there are several places that the salr master server details can be specified, including the /etc/salt/minion configuration file, configuration files located in /etc/salt/minion.d/ and dynamically (which I admit, I don't really understand yet).

I didn't see anything in the man pages to show this kind of info.

This would be useful to help troubleshoot and "explore" inherited installations.

gWaldo
  • 11,887
  • 8
  • 41
  • 68
NimbusScale
  • 297
  • 1
  • 2
  • 10

2 Answers2

1

There is a default grain with that information:

In a template or sls file:

{{ grains.master }}

From command line:

salt minion_id grains.item master
Diego Woitasen
  • 931
  • 5
  • 11
  • I suspect `` was meant. I for one didn't have `salt` available, just `salt-call`. There, the magic seemed to be `sudo salt-call grains.get master`, a command that Google has zero matches for, so surely I'm making a mistake. – Martin Dorey Oct 28 '21 at 00:19
0

Look in /etc/salt/minion first. If there isn't a master set explicitly there, salt minions default to trying to connect to salt, so check resolv.conf.

Joe Block
  • 696
  • 4
  • 12