Browse Source

manage sshd_config and ssh_config only if pillars are defined

master
ek9 7 years ago
parent
commit
038a51cdc8
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      openssh/config.sls

+ 4
- 0
openssh/config.sls View File

include: include:
- openssh - openssh


{% if salt['pillar.get']('sshd_config', False) %}
sshd_config: sshd_config:
file.managed: file.managed:
- name: {{ openssh.sshd_config }} - name: {{ openssh.sshd_config }}
- mode: 644 - mode: 644
- watch_in: - watch_in:
- service: openssh - service: openssh
{% endif %}


{% if salt['pillar.get']('ssh_config', False) %}
ssh_config: ssh_config:
file.managed: file.managed:
- name: {{ openssh.ssh_config }} - name: {{ openssh.ssh_config }}
- template: jinja - template: jinja
- user: root - user: root
- mode: 644 - mode: 644
{% endif %}


{% for keyType in ['ecdsa', 'dsa', 'rsa', 'ed25519'] %} {% for keyType in ['ecdsa', 'dsa', 'rsa', 'ed25519'] %}
{% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %} {% if salt['pillar.get']('openssh:generate_' ~ keyType ~ '_keys', False) %}

Loading…
Cancel
Save