瀏覽代碼

Added option to source ssh public keys from files.

tags/v0.45.0
Andrew Vant 9 年之前
父節點
當前提交
1f80412da8
共有 2 個文件被更改,包括 17 次插入0 次删除
  1. +5
    -0
      pillar.example
  2. +12
    -0
      users/init.sls

+ 5
- 0
pillar.example 查看文件

@@ -32,6 +32,11 @@ users:
# with the given keys
ssh_auth_file:
- PUBLICKEY
# If you prefer to keep public keys as files rather
# than inline in pillar, this works.
ssh_auth_sources:
- salt://keys/buser.id_rsa.pub

google_auth:
ssh: |
SOMEGAUTHHASHVAL

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

@@ -166,6 +166,18 @@ ssh_auth_{{ name }}_{{ loop.index0 }}:
{% endfor %}
{% endif %}

{% if 'ssh_auth_sources' in user %}
{% for pubkey_file in user['ssh_auth_sources'] %}
ssh_auth_source_{{ name }}_{{ loop.index0 }}:
ssh_auth.present:
- user: {{ name }}
- source: {{ pubkey_file }}
- require:
- file: {{ name }}_user
- user: {{ name }}_user
{% endfor %}
{% endif %}

{% if 'ssh_auth.absent' in user %}
{% for auth in user['ssh_auth.absent'] %}
ssh_auth_delete_{{ name }}_{{ loop.index0 }}:

Loading…
取消
儲存