adjust file permissions of public ssh-keys

This commit is contained in:
Daniel Kraemer 2017-09-28 08:22:25 +02:00
parent c78516f8e0
commit d8d2017629
2 changed files with 6 additions and 1 deletions

View File

@ -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,

View File

@ -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: