salt.modules.config

Return config information

salt.modules.config.backup_mode(backup='')

Return the backup mode

CLI Example:

salt '*' config.backup_mode
salt.modules.config.dot_vals(value)

Pass in a configuration value that should be preceded by the module name and a dot, this will return a list of all read key/value pairs

CLI Example:

salt '*' config.dot_vals host
salt.modules.config.gather_bootstrap_script(replace=False)

Download the salt-bootstrap script, set replace to True to refresh the script if it has already been downloaded

CLI Example:

salt '*' config.gather_bootstrap_script True
salt.modules.config.get(key, default='')

Attempt to retrieve the named value from opts, pillar, grains of the master config, if the named value is not available return the passed default. The default return is an empty string.

The value can also represent a value in a nested dict using a ":" delimiter for the dict. This means that if a dict looks like this:

{'pkg': {'apache': 'httpd'}}

To retrieve the value associated with the apache key in the pkg dict this key can be passed:

pkg:apache

This routine traverses these data stores in this order:

  • Local minion config (opts)
  • Minion's grains
  • Minion's pillar
  • Master config

CLI Example:

salt '*' config.get pkg:apache
salt.modules.config.manage_mode(mode)

Return a mode value, normalized to a string

CLI Example:

salt '*' config.manage_mode
salt.modules.config.merge(value, default='', omit_opts=False, omit_master=False, omit_pillar=False)

Retrieves an option based on key, merging all matches.

Same as option() except that it merges all matches, rather than taking the first match.

CLI Example:

salt '*' config.merge schedule
salt.modules.config.option(value, default='', omit_opts=False, omit_master=False, omit_pillar=False)

Pass in a generic option and receive the value that will be assigned

CLI Example:

salt '*' config.option redis.host
salt.modules.config.valid_fileproto(uri)

Returns a boolean value based on whether or not the URI passed has a valid remote file protocol designation

CLI Example:

salt '*' config.valid_fileproto salt://path/to/file