initial upload
This commit is contained in:
25
roles/ssh/templates/ssh_common.j2
Normal file
25
roles/ssh/templates/ssh_common.j2
Normal file
@@ -0,0 +1,25 @@
|
||||
# {{ ansible_managed }}
|
||||
{% macro ssh_config(settings, caller='') %}
|
||||
{% set sections = ('Host', 'Match') %}
|
||||
|
||||
{%- for key, value in settings|dictsort if key not in sections %}
|
||||
{% if value is sequence and value is not string %}
|
||||
{% for item in value %}
|
||||
{{ key }} {{ item }}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{{ key }} {{ ['no','yes'][value|int] if value in (False,True) else value }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{%- for section in sections if section in settings %}
|
||||
|
||||
{% for item in settings[section] %}
|
||||
{{ section }} {{ item[section] }}
|
||||
{% for key, value in item|dictsort if key != section %}
|
||||
{{ key }} {{ ['no','yes'][value|int] if value in (False,True) else value }}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% endfor -%}
|
||||
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user