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

46 lines
955 B
Plaintext
Raw Permalink Normal View History

2020-12-22 10:46:20 +00:00
# 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