Created
June 25, 2015 08:51
-
-
Save jpic/4a397a068e78cf3c2f53 to your computer and use it in GitHub Desktop.
YAML+Jinja code readability
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
{%- if something %} | |
{%- for name, data in groups %} | |
{{ name }}: | |
{%- if data.get('absent', False) %} | |
group.absent: | |
{%- else %} | |
group.present: | |
{%- endif %} | |
{%- if 'gid' in data %} | |
- gid: {{ data.gid }} | |
{%- endif %} | |
{%- if data.get('absent', False) %} | |
- purge: True | |
{%- endif %} | |
{%- endfor %} | |
{%- endif %} |
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
groups: | |
admin: | |
absent: True | |
sudo: | |
gid: 4000 |
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
sudo: | |
group.present: | |
- gid: 4000 | |
admin: | |
group.absent: | |
- purge: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment