Sfoglia il codice sorgente

Support "salt://path_to_keyname" ssh_key definition in users."user name".ssh_keys."privkey|pubkey" pillar data

master
Konstantin Nikolaev 6 anni fa
parent
commit
1dfef11303
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. +5
    -0
      users/init.sls

+ 5
- 0
users/init.sls Vedi File

@@ -194,7 +194,12 @@ users_{{ name }}_{{ key_name }}_key:
- mode: 600
{% endif %}
- show_diff: False
{%- set key_value = salt['pillar.get']('users:'+name+':ssh_keys:'+_key) %}
{%- if 'salt://' in key_value[:7] %}
- source: {{ key_value }}
{%- else %}
- contents_pillar: users:{{ name }}:ssh_keys:{{ _key }}
{%- endif %}
- require:
- user: users_{{ name }}_user
{% for group in user.get('groups', []) %}

Loading…
Annulla
Salva