Browse Source

Merge pull request #13 from accumulo/master

Add and support ssh_key_type attribute to allow for dsa ssh key pairs
tags/v0.45.0
Joseph Hall 11 years ago
parent
commit
4d9fb60715
2 changed files with 4 additions and 2 deletions
  1. +1
    -0
      pillar.example
  2. +3
    -2
      users/init.sls

+ 1
- 0
pillar.example View File

gid: 500 gid: 500
groups: groups:
- users - users
ssh_key_type: rsa
ssh_keys: ssh_keys:
privkey: PRIVATEKEY privkey: PRIVATEKEY
pubkey: PUBLICKEY pubkey: PUBLICKEY

+ 3
- 2
users/init.sls View File

{%- 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
{% 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…
Cancel
Save