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

Override pillar_target to pillar when running against running Minions #194

Merged
merged 1 commit into from
Nov 2, 2020
Merged
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
9 changes: 9 additions & 0 deletions salt_sproxy/_runners/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,15 @@ def execute(
# indefinitely.
timeout = None

if tgt_type == 'pillar_target':
# When using the -I option on the CLI, the tgt_type passed on is called
# `pillar_target`:
# https://github.com/saltstack/salt/blob/e9e48b7fb6a688f4f22d74a849d58c1c156563d1/salt/utils/parsers.py#L1266
# While if we want to use this against existing Minions, the option
# needs to be just `pillar`:
# https://github.com/saltstack/salt/blob/99385b50718d70d93fd5b83e61c0f4b3a402490c/salt/utils/minions.py#L359
tgt_type = 'pillar'

if preload_targeting or invasive_targeting:
_tgt = '*'
_tgt_type = 'glob'
Expand Down
1 change: 1 addition & 0 deletions salt_sproxy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ def run(self):
'grain',
'pcre',
'grain_pcre',
'pillar',
'pillar_pcre',
'pillar_target',
'nodegroup',
Expand Down