# Managed by Saltstack {%- for host, config in salt.pillar.get('ssh_hosts', {}).get(user, {}).items() %} Host {{ host }} {%- for key, val in config.items() %} {{ key }} {{ val }} {%- endfor %} {%- endfor %} {%- if salt.pillar.get('restic:client:environ:RESTIC_REPOSITORY', '').startswith('sftp:') %} {% set user=salt.pillar.get('restic:client:environ:RESTIC_REPOSITORY').split(':')[1] %} Host {{ user }} HostName kpi.keiran.us User {{ user }} Port 9022 IdentityFile /root/.ssh/id_rsa {%- endif %}