-
Notifications
You must be signed in to change notification settings - Fork 85
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
and add more OSes
#23
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# should contain the currently released version of the formula | ||
0.1.0 | ||
0.1.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
|
||
{## Start imports as ##} | ||
{## Start imports as ##} | ||
{% import_yaml 'template/defaults.yaml' as defaults %} | ||
{% import_yaml 'template/osfamilymap.yaml' ad osfamilymap %} | ||
{% import_yaml 'template/osmap.yaml' ad osmap %} | ||
{% import_yaml 'template/osfamilymap.yaml' as osfamilymap %} | ||
{% import_yaml 'template/osmap.yaml' as osmap %} | ||
|
||
{## merge the osfamilymap ##} | ||
{% set osfamily = salt['grains.filter_by']('osfamilymap', grain='os_family_map') or{} %} | ||
{## Merge the osfamilymap ##} | ||
{% set osfamily = salt['grains.filter_by'](osfamilymap, grain='os_family') or {} %} | ||
{% do salt['defaults.merge'](defaults['template'], osfamily) %} | ||
|
||
{## merge the osmap ##} | ||
{% set osmap = salt['grains.filter_by']('osmap', grain='os') or{} %} | ||
{% do salt['defaults.merge'](defaults['template'], osmap) %} | ||
{## Merge the osmap ##} | ||
{% set os = salt['grains.filter_by'](osmap, grain='os') or {} %} | ||
{% do salt['defaults.merge'](defaults['template'], os) %} | ||
|
||
{## merge the lookup ##} | ||
{% lookup = salt['pillar.get']('template:lookup', default={}, merge=True) %} | ||
{## Merge the lookup ##} | ||
{% set lookup = salt['pillar.get']('template:lookup', default={}) %} | ||
{% do salt['defaults.merge'](defaults['template'], lookup) %} | ||
|
||
{## merge the template pillar ##} | ||
{## Merge the template pillar ##} | ||
{% set template = salt['pillar.get']('template', default=defaults['template'], merge=True) %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
# | ||
# Setup variables using grains['os'] based logic. | ||
# Only add key:values that differ from `defaults.yaml` + `os_family.yaml`. | ||
--- | ||
javierbertoli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Ubuntu: | ||
pkg: template-ubuntu | ||
|
||
Fedora: | ||
pkg: template-fedora | ||
javierbertoli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Ubuntu: | ||
pkg: template-ubuntu | ||
Raspbian: {} | ||
|
||
SmartOS: {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that adding all these empty
os_family
s hashes might confuse a newcomer and let her assume that they have to be listed even if not covered by the formula?In that case, perhaps the line above can be rephrased, like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, just wanted to revive the useful comment that was in the
map.jinja
previously and show a list of OSes that formulas support. I do feel like I've come across the use of{}
before somewhere... perhaps a situation where the OS family (e.g.Debian
) makes no changes to the defaults yet the OS derivative (e.g.Ubuntu
) does? Maybe just used to explicitly define the OSes?In any case, your suggestion is excellent and I'll incorporate that.