Browse Source

Add ability to control SSH server status (default: on)

tags/v0.41.0
ek9 9 years ago
parent
commit
33344743b0
3 changed files with 10 additions and 1 deletions
  1. +1
    -0
      openssh/defaults.yaml
  2. +7
    -1
      openssh/init.sls
  3. +2
    -0
      pillar.example

+ 1
- 0
openssh/defaults.yaml View File

openssh: openssh:
sshd_enable: True
sshd_config: /etc/ssh/sshd_config sshd_config: /etc/ssh/sshd_config
sshd_config_src: salt://openssh/files/sshd_config sshd_config_src: salt://openssh/files/sshd_config
ssh_config: /etc/ssh/ssh_config ssh_config: /etc/ssh/ssh_config

+ 7
- 1
openssh/init.sls View File

pkg.installed: pkg.installed:
- name: {{ openssh.server }} - name: {{ openssh.server }}
{% endif %} {% endif %}
{% if openssh.sshd_enable is sameas true %}
service.running: service.running:
- enable: True
- enable: {{ openssh.sshd_enable }}
- name: {{ openssh.service }} - name: {{ openssh.service }}
{% if openssh.server is defined %} {% if openssh.server is defined %}
- require: - require:
- pkg: {{ openssh.server }} - pkg: {{ openssh.server }}
{% endif %} {% endif %}
{% else %}
service.dead:
- enable: False
- name: {{ openssh.service }}
{% endif %}

+ 2
- 0
pillar.example View File

VisualHostKey: 'no' VisualHostKey: 'no'


openssh: openssh:
# Controls if SSHD should be enabled/started
sshd_enable: true
auth: auth:
joe-valid-ssh-key-desktop: joe-valid-ssh-key-desktop:
- user: joe - user: joe

Loading…
Cancel
Save