0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2025-04-19 20:02:10 +02:00

Debian: Create privilege separation directory

On Debian-based system, the privilege separation directory is
`/run/sshd`. Since `/run` is a tmpfs filesystem, the init script is
responsible for creating the directory when starting `sshd`. However,
this directory might not exist if the `ssh` service has not been
started yet.

This patch ensures that the directory exists before storing the
configuration file. It is required to prevent the `check_cmd` from
failing; specifically, to prevent `sshd` from complaining that the
directory does not exist.
This commit is contained in:
Philippe Grégoire 2018-08-23 16:16:07 -04:00
parent 6e077f5dbe
commit 4c822ba844
No known key found for this signature in database
GPG Key ID: A14AA6DA679C2177

View File

@ -6,6 +6,16 @@ include:
- openssh
{% if manage_sshd_config %}
{% if 'Debian' == salt['grains.get']('os_family') %}
/run/sshd:
file.directory:
- user: 0
- group: 0
- mode: 0755
- require_in:
- file: sshd_config
{% endif %}
sshd_config:
file.managed:
- name: {{ openssh.sshd_config }}