ssh_keys: | ssh_keys: | ||||
privkey: PRIVATEKEY | privkey: PRIVATEKEY | ||||
pubkey: PUBLICKEY | 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: PRIVATEKEY | ||||
foobar.pub: PUBLICKEY | foobar.pub: PUBLICKEY | ||||
# ... or you can pull them from a different pillar, | # ... or you can pull them from a different pillar, |
- name: {{ home }}/.ssh/{{ key_name }} | - name: {{ home }}/.ssh/{{ key_name }} | ||||
- user: {{ name }} | - user: {{ name }} | ||||
- group: {{ user_group }} | - group: {{ user_group }} | ||||
{% if key_name.endswith(".pub") %} | |||||
- mode: 644 | |||||
{% else %} | |||||
- mode: 600 | - mode: 600 | ||||
{% endif %} | |||||
- show_diff: False | - show_diff: False | ||||
- contents_pillar: users:{{ name }}:ssh_keys:{{ _key }} | - contents_pillar: users:{{ name }}:ssh_keys:{{ _key }} | ||||
- require: | - require: |