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

fix(map.jinja): use pillar/config .get according to __cli option #102

Merged
merged 1 commit into from
May 15, 2019
Merged
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: 1 addition & 1 deletion template/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
) %}

{#- Merge the template config (e.g. from pillar) #}
{%- set template = salt['config.get']('template', default=defaults, merge=True) %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR the key in "salt vs. salt-ssh" was that defaults.merge does/did not work on salt-ssh. I suppose config.get works just fine, but I'd have to test that.

So if we could use config.get and stick to grains.filter_by (instead of defaults.merge) we'd just need one code path without distinguishing between salt and salt-ssh.

From my tests salt-ssh seems to be able to use config.get:

% salt-ssh host config.get apache:configdir
 host:
    /etc/apache2
 % salt-ssh host pillar.get apache:configdir
host:
    /etc/apache2

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.get wasn't ever the issue itself (for salt-ssh) but the problem faced has been merging back the return from config.get into the rest of the map. defaults.merge is one way of reliably achieving this but if grains.filter_by can be coerced do it instead, that's even better.

{%- set template = salt['config.get']('template', default=defaults) %}