blob: 82f66a2f5c8b6cbb6ed47d650f9ba3ad7d6f33a4 [file] [log] [blame]
{%- from "openssh/map.jinja" import client with context %}
{%- if client.enabled %}
include:
- openssh.client.service
{%- for user_name, user in client.user.iteritems() %}
{%- for host in user.get('known_hosts', []) %}
{{ user_name }}_known_hosts_{{ host.name }}:
ssh_known_hosts.present:
- user: {{ user_name }}
- name: {{ host.name }}
- enc: {{ host.get('type', 'ecdsa') }}
- fingerprint: {{ host.fingerprint }}
- require:
- pkg: openssh_client_packages
- file: {{ user.user.home }}/.ssh
{%- endfor %}
{%- endfor %}
{%- endif %}