iterate order; common; salt configs

This commit is contained in:
2019-04-12 21:46:06 -04:00
parent 42784e1d5b
commit 0c72d02792
10 changed files with 75 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
# Managed by Salt
{% for comment, keydata in pillar['authorized_keys'].items() -%}
{% set comments = pillar['authorized_keys'].keys()|sort -%}
{% for comment in comments -%}
{% set keydata = pillar['authorized_keys'][comment] -%}
{{keydata}} {{comment}}
{% endfor -%}

View File

@@ -1,7 +1,11 @@
# Managed by salt
{% for host, config in pillar['ssh_config'].items() -%}
{% set hosts = pillar['ssh_config'].keys()|sort -%}
{% for host in hosts -%}
{% set config = pillar['ssh_config'][host] %}
Host {{host}}
{%- for key, val in config.items() %}
{%- set keys = config.keys()|sort %}
{%- for key in keys %}
{%- set val = config[key] %}
{{key}} {{val -}}
{% endfor %}
{% endfor -%}