Przeglądaj źródła

Merge pull request #79 from leansalt/server-service-control

Add ability to control SSH server service status (default: on)
tags/v0.41.0
Brian Jackson 8 lat temu
rodzic
commit
b9689cedff
3 zmienionych plików z 10 dodań i 1 usunięć
  1. +1
    -0
      openssh/defaults.yaml
  2. +7
    -1
      openssh/init.sls
  3. +2
    -0
      pillar.example

+ 1
- 0
openssh/defaults.yaml Wyświetl plik

@@ -1,4 +1,5 @@
openssh:
sshd_enable: True
sshd_config: /etc/ssh/sshd_config
sshd_config_src: salt://openssh/files/sshd_config
ssh_config: /etc/ssh/ssh_config

+ 7
- 1
openssh/init.sls Wyświetl plik

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

+ 2
- 0
pillar.example Wyświetl plik

@@ -81,6 +81,8 @@ ssh_config:
VisualHostKey: 'no'

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

Ładowanie…
Anuluj
Zapisz