Created
April 7, 2016 12:27
-
-
Save anonymous/92855045225c75d10a8af65439aa0932 to your computer and use it in GitHub Desktop.
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
Results of cp.get_file_str | |
------------------------- | |
# TYPE DATABASE USER CIDR-ADDRESS METHOD | |
{%- set postgres_databases = salt['pillar.get']('postgres:databases') %} | |
{%- for server, hba_config in salt['mine.get']('*', 'postgres-hba').items() %} | |
{{ '\n### '~server~' ###' }} | |
{%- for hba, hba_props in hba_config.iteritems() %} | |
{{ '\n# '~hba }} | |
{%- for id, hba_entry in hba_props.iteritems() %} | |
{{ hba_entry.get('type') }} {{ postgres_databases[hba_entry.get('database_connection')]['database'] }} {{ postgres_databases[hba_entry.get('database_connection')]['user'] }}{% if 'cidr' in hba_entry %} {{ hba_entry.get('cidr') }}{% endif %} {{ hba_entry.get('method') }} | |
{%- endfor %} | |
{%- endfor %} | |
{%- endfor %} | |
Results of cp.get_template | |
-------------------------- | |
# TYPE DATABASE USER CIDR-ADDRESS METHOD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment