Specify config clause only if defined in pillar.

Signed-off-by: POTIER Mathieu <mathieu.potier@onzeway.eu>
This commit is contained in:
POTIER Mathieu 2015-11-18 20:33:50 +01:00
parent dda1fb5128
commit f55445211c
1 changed files with 4 additions and 0 deletions

View File

@ -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 -%}