Page MenuHomeDevCentral

D1077.id2750.diff
No OneTemporary

D1077.id2750.diff

diff --git a/map.jinja b/map.jinja
--- a/map.jinja
+++ b/map.jinja
@@ -39,6 +39,21 @@
},
}, default='Debian') %}
+{% set paths = salt['grains.filter_by']({
+ 'FreeBSD': {
+ 'sftp': '/usr/libexec/sftp-server',
+ },
+ 'Debian': {
+ 'sftp': '/usr/lib/openssh/sftp-server',
+ },
+ 'RedHat': {
+ 'sftp': '/usr/libexec/openssh/sftp-server',
+ },
+ 'Arch': {
+ 'sftp': '/usr/lib/ssh/sftp-server',
+ },
+}, default='FreeBSD') %}
+
{% set packages = salt['grains.filter_by']({
'Debian' : {
'ag': 'silversearcher-ag',
diff --git a/roles/core/sshd/files/sshd_config b/roles/core/sshd/files/sshd_config
--- a/roles/core/sshd/files/sshd_config
+++ b/roles/core/sshd/files/sshd_config
@@ -29,4 +29,4 @@
AcceptEnv LANG LC_*
# SFTP
-Subsystem sftp /usr/lib/openssh/sftp-server
+Subsystem sftp {{ sftp }}
diff --git a/roles/core/sshd/init.sls b/roles/core/sshd/init.sls
--- a/roles/core/sshd/init.sls
+++ b/roles/core/sshd/init.sls
@@ -6,6 +6,8 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
+{% from "map.jinja" import paths with context %}
+
# -------------------------------------------------------------
# OpenSSH
# -------------------------------------------------------------
@@ -13,6 +15,9 @@
/etc/ssh/sshd_config:
file.managed:
- source: salt://roles/core/sshd/files/sshd_config
+ - template: jinja
+ - context:
+ sftp: {{ paths.sftp }}
# -------------------------------------------------------------
# PAM

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 23, 19:53 (15 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2257297
Default Alt Text
D1077.id2750.diff (1 KB)

Event Timeline