mirror of
https://github.com/saltstack-formulas/users-formula.git
synced 2024-12-18 10:32:55 +01:00
Merge pull request #13 from accumulo/master
Add and support ssh_key_type attribute to allow for dsa ssh key pairs
This commit is contained in:
commit
4d9fb60715
@ -17,6 +17,7 @@ users:
|
|||||||
gid: 500
|
gid: 500
|
||||||
groups:
|
groups:
|
||||||
- users
|
- users
|
||||||
|
ssh_key_type: rsa
|
||||||
ssh_keys:
|
ssh_keys:
|
||||||
privkey: PRIVATEKEY
|
privkey: PRIVATEKEY
|
||||||
pubkey: PUBLICKEY
|
pubkey: PUBLICKEY
|
||||||
|
@ -77,9 +77,10 @@ user_keydir_{{ name }}:
|
|||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{% if 'ssh_keys' in user %}
|
{% if 'ssh_keys' in user %}
|
||||||
|
{% set key_type = 'id_' + user.get('ssh_key_type', 'rsa') %}
|
||||||
user_{{ name }}_private_key:
|
user_{{ name }}_private_key:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh/id_rsa
|
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh/{{ key_type }}
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- group: {{ user_group }}
|
- group: {{ user_group }}
|
||||||
- mode: 600
|
- mode: 600
|
||||||
@ -91,7 +92,7 @@ user_{{ name }}_private_key:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
user_{{ name }}_public_key:
|
user_{{ name }}_public_key:
|
||||||
file.managed:
|
file.managed:
|
||||||
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh/id_rsa.pub
|
- name: {{ user.get('home', '/home/{0}'.format(name)) }}/.ssh/{{ key_type }}.pub
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- group: {{ user_group }}
|
- group: {{ user_group }}
|
||||||
- mode: 644
|
- mode: 644
|
||||||
|
Loading…
Reference in New Issue
Block a user