This repository has been archived on 2023-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
salt-states_old/ssh/init.sls
2020-12-22 11:46:20 +01:00

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