mirror of
https://github.com/saltstack-formulas/users-formula.git
synced 2026-10-05 01:45:38 +02:00
Add ~/.ssh/config management
This adds the ability to manage the ~/.ssh/config file for users.
This commit is contained in:
1 parent
3fc2a2bac9
commit
57c82f3324
2 files changed
+29
No files matched your search
@@ -208,6 +208,24 @@ users_ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if 'ssh_config' in user %}
|
||||
users_ssh_config_{{ name }}:
|
||||
file.managed:
|
||||
- name: {{ home }}/.ssh/config
|
||||
- user: {{ name }}
|
||||
- group: {{ user_group }}
|
||||
- mode: 640
|
||||
- contents: |
|
||||
# Managed by Saltstack
|
||||
{% for label, setting in user.ssh_config.items() %}
|
||||
# {{ label }}
|
||||
Host {{ setting.get('hostname') }}
|
||||
{%- for opts in setting.get('options') %}
|
||||
{{ opts }}
|
||||
{%- endfor %}
|
||||
{% endfor -%}
|
||||
{% endif %}
|
||||
|
||||
{% if 'sudouser' in user and user['sudouser'] %}
|
||||
|
||||
users_sudoer-{{ name }}:
|
||||
|
||||
Reference in new issue
Block a user