瀏覽代碼

Move ssh_auth_file key processing to before ssh_auth key to extend instead of overwrite functionality.

tags/v0.45.0
root 9 年之前
父節點
當前提交
d416b6d839
共有 1 個檔案被更改,包括 11 行新增12 行删除
  1. +11
    -12
      users/init.sls

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

@@ -142,6 +142,17 @@ user_{{ name }}_public_key:
{% endfor %}
{% endif %}

{% if 'ssh_auth_file' in user %}
{{ home }}/.ssh/authorized_keys:
file.managed:
- user: {{ name }}
- group: {{ name }}
- mode: 600
- contents: |
{% for auth in user.ssh_auth_file -%}
{{ auth }}
{% endfor -%}
{% endif %}

{% if 'ssh_auth' in user %}
{% for auth in user['ssh_auth'] %}
@@ -167,18 +178,6 @@ ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
{% endfor %}
{% endif %}

{% if 'ssh_auth_file' in user %}
{{ home }}/.ssh/authorized_keys:
file.managed:
- user: {{ name }}
- group: {{ name }}
- mode: 600
- contents: |
{% for auth in user.ssh_auth_file -%}
{{ auth }}
{% endfor -%}
{% endif %}

{% if 'sudouser' in user and user['sudouser'] %}

sudoer-{{ name }}:

Loading…
取消
儲存