initial upload
This commit is contained in:
8
roles/ssh/templates/etc_ssh_ssh_config.j2
Normal file
8
roles/ssh/templates/etc_ssh_ssh_config.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# See the ssh_config(5) manpage for details
|
||||
|
||||
{% from 'ssh_common.j2' import ssh_config with context %}
|
||||
{% call ssh_config(ssh_client_settings) %}{% endcall %}
|
||||
|
||||
# EOF
|
||||
8
roles/ssh/templates/etc_ssh_sshd_config.j2
Normal file
8
roles/ssh/templates/etc_ssh_sshd_config.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
# See the sshd_config(5) manpage for details
|
||||
|
||||
{% from 'ssh_common.j2' import ssh_config with context %}
|
||||
{% call ssh_config(ssh_server_settings) %}{% endcall %}
|
||||
|
||||
# EOF
|
||||
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