Browse Source

Specify config clause only if defined in pillar.

Signed-off-by: POTIER Mathieu <mathieu.potier@onzeway.eu>
master
POTIER Mathieu 9 years ago
parent
commit
f55445211c
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      openssh/auth.sls

+ 4
- 0
openssh/auth.sls View File

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

Loading…
Cancel
Save