mirror of
https://github.com/saltstack-formulas/users-formula.git
synced 2026-05-22 21:44:25 +02:00
Added authorized_keys template, update init for support.
This commit is contained in:
parent
76610eb63e
commit
2f442b1e0d
6
users/files/authorized_keys.jinja
Normal file
6
users/files/authorized_keys.jinja
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{% for name, user in pillar.get('users', {}).items() if user.absent is not defined or not user.absent %}
|
||||||
|
|
||||||
|
{% for auth in user['ssh_auth'] %}
|
||||||
|
ssh_auth_{{ name }}_{{ loop.index0 }} {{ auth }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
||||||
@ -112,17 +112,14 @@ user_{{ name }}_public_key:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if 'ssh_auth' in user %}
|
{% if 'ssh_auth' in user %}
|
||||||
{% for auth in user['ssh_auth'] %}
|
file.managed:
|
||||||
ssh_auth_{{ name }}_{{ loop.index0 }}:
|
- name: /home/{{ name }}/.ssh/authorized_keys
|
||||||
ssh_auth.present:
|
- source: salt://users/files/authorized_keys.jinja
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- name: {{ auth }}
|
- group: {{ name }}
|
||||||
- require:
|
- mode: 644
|
||||||
- file: {{ name }}_user
|
- template: jinja
|
||||||
- user: {{ name }}_user
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user