mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Fixing vault when used with pillar over salt-ssh
This commit is contained in:
parent
0cbe93cd69
commit
259e60e5d4
@ -98,7 +98,7 @@ def _get_vault_connection():
|
||||
Get the connection details for calling Vault, from local configuration if
|
||||
it exists, or from the master otherwise
|
||||
'''
|
||||
if 'vault' in __opts__ and __opts__.get('__role', 'minion') == 'master':
|
||||
def _use_local_config():
|
||||
log.debug('Using Vault connection details from local config')
|
||||
try:
|
||||
return {
|
||||
@ -108,6 +108,11 @@ def _get_vault_connection():
|
||||
except KeyError as err:
|
||||
errmsg = 'Minion has "vault" config section, but could not find key "{0}" within'.format(err.message)
|
||||
raise salt.exceptions.CommandExecutionError(errmsg)
|
||||
|
||||
if 'vault' in __opts__ and __opts__.get('__role', 'minion') == 'master':
|
||||
return _use_local_config()
|
||||
elif '_ssh_version' in __opts__:
|
||||
return _use_local_config()
|
||||
else:
|
||||
log.debug('Contacting master for Vault connection details')
|
||||
return _get_token_and_url_from_master()
|
||||
|
Loading…
Reference in New Issue
Block a user