瀏覽代碼

Specify config clause only if defined in pillar.

Signed-off-by: POTIER Mathieu <mathieu.potier@onzeway.eu>
master
POTIER Mathieu 9 年之前
父節點
當前提交
f55445211c
共有 1 個檔案被更改,包括 4 行新增0 行删除
  1. +4
    -0
      openssh/auth.sls

+ 4
- 0
openssh/auth.sls 查看文件

@@ -38,14 +38,18 @@ include:
{{ print_name(identifier, key) }}:
ssh_auth.present:
{{ print_ssh_auth(identifier, key) }}
{%- if 'sshd_config' in pillar and 'AuthorizedKeysFile' in pillar['sshd_config'] %}
- config: {{ pillar['sshd_config']['AuthorizedKeysFile'] }}
{% endif -%}
- require:
- service: {{ openssh.service }}
{%- else %}
{{ print_name(identifier, key) }}:
ssh_auth.absent:
{{ print_ssh_auth(identifier, key) }}
{%- if 'sshd_config' in pillar and 'AuthorizedKeysFile' in pillar['sshd_config'] %}
- config: {{ pillar['sshd_config']['AuthorizedKeysFile'] }}
{% endif -%}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}

Loading…
取消
儲存