瀏覽代碼

adjust file permissions of public ssh-keys

master
Daniel Kraemer 7 年之前
父節點
當前提交
d8d2017629
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. +2
    -1
      pillar.example
  2. +4
    -0
      users/init.sls

+ 2
- 1
pillar.example 查看文件

@@ -50,7 +50,8 @@ users:
ssh_keys:
privkey: PRIVATEKEY
pubkey: PUBLICKEY
# you can provide multiple keys, the keyname is takes as filename
# you can provide multiple keys, the keyname is taken as filename
# make sure your public keys suffix is .pub
foobar: PRIVATEKEY
foobar.pub: PUBLICKEY
# ... or you can pull them from a different pillar,

+ 4
- 0
users/init.sls 查看文件

@@ -183,7 +183,11 @@ users_{{ name }}_{{ key_name }}_key:
- name: {{ home }}/.ssh/{{ key_name }}
- user: {{ name }}
- group: {{ user_group }}
{% if key_name.endswith(".pub") %}
- mode: 644
{% else %}
- mode: 600
{% endif %}
- show_diff: False
- contents_pillar: users:{{ name }}:ssh_keys:{{ _key }}
- require:

Loading…
取消
儲存