.ssh/config

This commit is contained in:
2019-03-29 22:42:39 -04:00
parent d0059c2308
commit 0e597c7eed
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
# Managed by salt
{% for host, config in pillar['ssh_config'].items() %}
Host {{host}}
{% for key, val in config.items() %}
{{key}} {{val }}
{% endfor -%}
{% endfor -%}

View File

@@ -3,4 +3,24 @@
file.managed: file.managed:
- source: 'salt://ssh/files/authorized_keys.jinja' - source: 'salt://ssh/files/authorized_keys.jinja'
- template: jinja - template: jinja
- user: root
- group: root
- mode: 400 - mode: 400
/root/.ssh/config:
file.managed:
- source: 'salt://ssh/files/ssh_config.jinja'
- template: jinja
- user: root
- group: root
- mode: 400
{% for user in salt.pillar.get('authkey_users', []) %}
/home/{{user}}/.ssh/authorized_keys:
file.managed:
- source: 'salt://ssh/files/authorized_keys.jinja'
- template: jinja
- user: {{user}}
- group: {{user}}
- mode: 400
{% endfor %}