paulbsd-salt/states/ssh/sshd_config.j2
2020-10-10 14:14:08 +02:00

22 lines
660 B
Django/Jinja

## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "ssh/map.jinja" import ssh with context %}
{%- set net4=[] %}
{%- for key, value in salt['pillar.get']('net:ipv4_networks').items() -%}
{%- do net4.append( value.ip + "/" + value.mask ) -%}
{%- endfor -%}
{%- set net6=[] -%}
{%- for key, value in salt['pillar.get']('net:ipv6_networks').items() -%}
{%- do net6.append( value.ip + "/" + value.mask ) -%}
{%- endfor -%}
{%- for key, value in ssh.sshd_config.items() %}
{{ key }} {{ value }}
{%- endfor %}
Match Address {{ net4|join(',') }}
PasswordAuthentication yes
Match Address {{ net6|join(',') }}
PasswordAuthentication yes