Files
salt-states/users/files/ssh_hosts.jinja
Keiran Snowden 5be2a914ac manage restic rsa
2023-11-27 01:42:37 -05:00

16 lines
511 B
Django/Jinja

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