Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow pillar to be used in vault policies #43288

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions salt/modules/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
- web
- database

`pillar` can also be used.

The minion will have the policies ``saltstack/by-role/web`` and
``saltstack/by-role/database``. Note however that list members which do
not have simple string representations, such as dictionaries or objects,
Expand Down
4 changes: 2 additions & 2 deletions salt/runners/vault.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ def _get_policies(minion_id, config):
'''
Get the policies that should be applied to a token for minion_id
'''
_, grains, _ = salt.utils.minions.get_minion_data(minion_id, __opts__)
_, grains, pillar = salt.utils.minions.get_minion_data(minion_id, __opts__)
policy_patterns = config.get(
'policies',
['saltstack/minion/{minion}', 'saltstack/minions']
)
mappings = {'minion': minion_id, 'grains': grains or {}}
mappings = {'minion': minion_id, 'grains': grains or {}, 'pillar': pillar or {}}

policies = []
for pattern in policy_patterns:
Expand Down