# {{ 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 %}