Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3747689
D1130.id2888.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D1130.id2888.diff
View Options
diff --git a/map.jinja b/map.jinja
--- a/map.jinja
+++ b/map.jinja
@@ -142,3 +142,22 @@
'verbiste': 'fr-verbiste',
},
}, default='Debian') %}
+
+{# -------------------------------------------------------------
+ Capabilities of OS and distributions
+
+ :: MOTD-printed-at-login
+ Login mechanism, through PAM or dotfiles,
+ prints the MOTD when a session is opened.
+
+ When at False, OpenSSH will take care of it.
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #}
+
+{% set capabilities = salt['grains.filter_by']({
+ 'Debian': {
+ 'MOTD-printed-at-login': True,
+ },
+ 'FreeBSD' : {
+ 'MOTD-printed-at-login': False,
+ },
+}, default='Debian') %}
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
@@ -25,7 +25,7 @@
UsePAM yes
# Misc options
-PrintMotd no
+PrintMotd {{ "yes" if print_motd else "no" }}
AcceptEnv LANG LC_*
# 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,7 +6,7 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-{% from "map.jinja" import paths with context %}
+{% from "map.jinja" import paths, capabilities with context %}
# -------------------------------------------------------------
# OpenSSH
@@ -18,6 +18,7 @@
- template: jinja
- context:
sftp: {{ paths.sftp }}
+ print_motd: {{ not capabilities['MOTD-printed-at-login'] }}
# -------------------------------------------------------------
# PAM
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 03:55 (21 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2248475
Default Alt Text
D1130.id2888.diff (1 KB)
Attached To
Mode
D1130: Print MOTD through OpenSSH when needed
Attached
Detach File
Event Timeline
Log In to Comment