manage restic rsa

This commit is contained in:
Keiran Snowden
2023-11-27 01:42:37 -05:00
parent c1a5c8d95b
commit 5be2a914ac
8 changed files with 63 additions and 28 deletions

View File

@@ -1,6 +1,15 @@
{% for host, config in salt.pillar.get('ssh_hosts')[user].items() -%}
# Managed by Saltstack
{%- for host, config in salt.pillar.get('ssh_hosts', {}).get(user, {}).items() %}
Host {{ host }}
{%- for key, val in config %}
{%- 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 %}