46 lines
955 B
Plaintext
46 lines
955 B
Plaintext
# Pillar data:
|
|
#
|
|
# ssh:
|
|
# sshd:
|
|
# port: <port number>
|
|
|
|
install OpenSSH:
|
|
pkg.installed:
|
|
{% if grains['os_family'] == 'Suse' %}
|
|
- name: openssh
|
|
{% elif grains['os_family'] == 'Debian' %}
|
|
- name: ssh
|
|
{% endif %}
|
|
- refresh: False
|
|
|
|
/etc/ssh/ssh_known_hosts:
|
|
file.managed:
|
|
- source: salt://ssh/files/ssh_known_hosts
|
|
- user: root
|
|
- group: root
|
|
- mode: 0644
|
|
|
|
/etc/ssh/sshd_config:
|
|
file.managed:
|
|
- source: salt://ssh/files/sshd_config.jinja
|
|
- template: jinja
|
|
- user: root
|
|
- group: root
|
|
- mode: 0640
|
|
|
|
OpenSSH Service:
|
|
service.running:
|
|
{% if grains['os_family'] == 'Suse' %}
|
|
- name: sshd
|
|
{% elif grains['os_family'] == 'Debian' %}
|
|
- name: ssh
|
|
{% endif %}
|
|
- enable: True
|
|
- watch:
|
|
{% if grains['os_family'] == 'Suse' %}
|
|
- pkg: openssh
|
|
{% elif grains['os_family'] == 'Debian' %}
|
|
- pkg: ssh
|
|
{% endif %}
|
|
- file: /etc/ssh/sshd_config
|