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

map.jinja: use grains.filter_by instead of defaults.merge #25

Merged
merged 2 commits into from
Feb 12, 2019

Conversation

alxwr
Copy link
Member

@alxwr alxwr commented Feb 12, 2019

@myii
Copy link
Member

myii commented Feb 12, 2019

@alxwr Excellent, looking good at a first glance. Glad you added osfingermap as well. When I get a bit more time, I'll just run a couple of tests and then we're good to go. Thanks for the PR!

@alxwr
Copy link
Member Author

alxwr commented Feb 12, 2019

@myii Thanks for testing!

#
# Setup variables using grains['osfinger'] based logic.
# You just need to add the key:values for an `osfinger` that differ
# from `defaults.yaml` + `os_family.yaml`.
Copy link
Member

Choose a reason for hiding this comment

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

@alxwr If you're still around, then this will be:

`defaults.yaml` + `os_family.yaml` + `osmap.yaml`

If not, I'll merge anyway and add that to a future PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done :-) Thanks for the review!

Copy link
Member

Choose a reason for hiding this comment

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

@alxwr Don't go anywhere! I've got another point that needs to be resolved. Give me 2-3 minutes...

Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

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

@alxwr Just need this last fix and we're good to go, thanks!

@@ -5,18 +5,18 @@
{% import_yaml 'template/defaults.yaml' as defaults %}
Copy link
Member

Choose a reason for hiding this comment

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

defaults => default_settings!

Copy link
Member Author

Choose a reason for hiding this comment

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

Sry, I missed that. (It's late here.)

{## Merge the lookup ##}
{% set lookup = salt['pillar.get']('template:lookup', default={}) %}
{% do salt['defaults.merge'](defaults['template'], lookup) %}
{% set defaults = salt['grains.filter_by'](default_settings,
Copy link
Member

Choose a reason for hiding this comment

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

Because of this change here.

Copy link
Member Author

Choose a reason for hiding this comment

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

@alxwr Just need this last fix and we're good to go, thanks!

Should be fixed now. Thanks for reviewing!

because defaults.merge does not work with salt-ssh.
saltstack/salt#51605

Added osfingermap.yaml.
@myii myii merged commit 7f19fd5 into saltstack-formulas:master Feb 12, 2019
@myii
Copy link
Member

myii commented Feb 12, 2019

@alxwr Fantastic, thanks for the extra effort. Merged.

@myii
Copy link
Member

myii commented Aug 9, 2019

@noelmcloughlin has a PR (saltstack-formulas/firewalld-formula#29) that mentions that there is no osfinger (and osmajorrelease) grain on Arch Linux. It's worth investigating whether that will result in errors in map.jinja, now that it is based on osfinger.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants