瀏覽代碼

Merge pull request #13 from accumulo/master

Add and support ssh_key_type attribute to allow for dsa ssh key pairs
lookup-fix-3
Joseph Hall 10 年之前
父節點
當前提交
4d9fb60715
共有 2 個檔案被更改,包括 4 行新增2 行删除
  1. +1
    -0
      pillar.example
  2. +3
    -2
      users/init.sls

+ 1
- 0
pillar.example 查看文件

@@ -17,6 +17,7 @@ users:
gid: 500
groups:
- users
ssh_key_type: rsa
ssh_keys:
privkey: PRIVATEKEY
pubkey: PUBLICKEY

+ 3
- 2
users/init.sls 查看文件

@@ -77,9 +77,10 @@ user_keydir_{{ name }}:
{%- endfor %}

{% if 'ssh_keys' in user %}
{% set key_type = 'id_' + user.get('ssh_key_type', 'rsa') %}
user_{{ name }}_private_key:
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 }}
- group: {{ user_group }}
- mode: 600
@@ -91,7 +92,7 @@ user_{{ name }}_private_key:
{% endfor %}
user_{{ name }}_public_key:
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 }}
- group: {{ user_group }}
- mode: 644

Loading…
取消
儲存