mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
set role for loading minion config
When the minion config is loaded by the MasterMinion, the role is not set, so the vault sdb tries to communicate with the master instead of just using the options it already has to connect to vault. This also fixes for loading vault sdb values for salt-cloud
This commit is contained in:
parent
c5af2e5048
commit
bfee1cead6
2 changed files with 8 additions and 2 deletions
|
@ -2150,7 +2150,8 @@ def minion_config(path,
|
|||
defaults=None,
|
||||
cache_minion_id=False,
|
||||
ignore_config_errors=True,
|
||||
minion_id=None):
|
||||
minion_id=None,
|
||||
role='minion'):
|
||||
'''
|
||||
Reads in the minion configuration file and sets up special options
|
||||
|
||||
|
@ -2190,6 +2191,7 @@ def minion_config(path,
|
|||
opts = apply_minion_config(overrides, defaults,
|
||||
cache_minion_id=cache_minion_id,
|
||||
minion_id=minion_id)
|
||||
opts['__role'] = role
|
||||
apply_sdb(opts)
|
||||
_validate_opts(opts)
|
||||
return opts
|
||||
|
|
|
@ -739,7 +739,11 @@ class MasterMinion(object):
|
|||
matcher=True,
|
||||
whitelist=None,
|
||||
ignore_config_errors=True):
|
||||
self.opts = salt.config.minion_config(opts['conf_file'], ignore_config_errors=ignore_config_errors)
|
||||
self.opts = salt.config.minion_config(
|
||||
opts['conf_file'],
|
||||
ignore_config_errors=ignore_config_errors,
|
||||
role='master'
|
||||
)
|
||||
self.opts.update(opts)
|
||||
self.whitelist = whitelist
|
||||
self.opts['grains'] = salt.loader.grains(opts)
|
||||
|
|
Loading…
Add table
Reference in a new issue