salt.roster.dir

Create a salt roster out of a flat directory of files.

Each filename in the directory is a minion id. The contents of each file is rendered using the salt renderer system.

Consider the following configuration for example:

config/master:

... roster: dir roster_dir: config/roster.d ...

Where the directory config/roster.d contains two files:

config/roster.d/minion-x:

host: minion-x.example.com port: 22 sudo: true user: ubuntu

config/roster.d/minion-y:

host: minion-y.example.com port: 22 sudo: true user: gentoo

The roster would find two minions: minion-x and minion-y, with the given host, port, sudo and user settings.

The directory roster also extends the concept of roster defaults by supporting a roster_domain value in config:

... roster_domain: example.org ...

If that option is set, then any roster without a 'host' setting will have an implicit host of its minion id + '.' + the roster_domain. (The default roster_domain is the empty string, so you can also name the files the fully qualified name of each host. However, if you do that, then the fully qualified name of each host is also the minion id.)

This makes it possible to avoid having to specify the hostnames when you always want them to match their minion id plus some domain.

salt.roster.dir.targets(tgt, tgt_type='glob', **kwargs)

Return the targets from the directory of flat yaml files, checks opts for location.