salt-statetree/applications/ssh.sls
2023-07-30 13:01:00 +02:00

30 lines
712 B
Text

applications_ssh_pkgs:
pkg.installed:
- pkgs:
- openssh-server
applications_ssh_add_keys:
file.managed:
- name: /root/.ssh/authorized_keys
- source: salt://{{ tpldir }}/files/ssh_authorized_keys
- makedirs: True
- user: root
- group: root
- require:
- applications_ssh_pkgs
applications_ssh_configuration:
file.managed:
- name: /etc/ssh/sshd_config
- source: salt://{{ tpldir }}/files/ssh_sshd_config
applications_ssh_enable:
service.running:
- name: sshd
- enable: True
- watch:
- applications_ssh_configuration
- applications_ssh_add_keys
- require:
- applications_ssh_configuration
- applications_ssh_add_keys