.ssh/config
This commit is contained in:
7
ssh/files/ssh_config.jinja
Normal file
7
ssh/files/ssh_config.jinja
Normal 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 -%}
|
||||||
20
ssh/init.sls
20
ssh/init.sls
@@ -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 %}
|
||||||
|
|||||||
Reference in New Issue
Block a user