Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3774488
D974.id2593.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
D974.id2593.diff
View Options
diff --git a/map.jinja b/map.jinja
--- a/map.jinja
+++ b/map.jinja
@@ -21,3 +21,16 @@
'manager': 'rc',
},
}, default='Debian') %}
+
+{% set shells = salt['grains.filter_by']({
+ 'Debian': {
+ 'bash': '/bin/bash',
+ 'fish': '/usr/bin/fish',
+ 'tcsh': '/usr/bin/tcsh',
+ },
+ 'FreeBSD' : {
+ 'bash': '/usr/local/bin/bash',
+ 'fish': '/usr/local/bin/fish',
+ 'tcsh': '/bin/tcsh',
+ },
+}, default='Debian') %}
diff --git a/pillar/users/shellusers.sls b/pillar/users/shellusers.sls
--- a/pillar/users/shellusers.sls
+++ b/pillar/users/shellusers.sls
@@ -28,11 +28,7 @@
uid: 2005
dereckson:
fullname: Sebastien Santoro
- {% if grains['os'] == 'FreeBSD' %}
- shell: /bin/tcsh
- {% else %}
- shell: /usr/bin/tcsh
- {% endif %}
+ shell: tcsh
uid: 5001
sandlayth:
fullname: Yassine Hadj Messaoud
@@ -57,11 +53,7 @@
uid: 2011
c2c:
fullname: c2c
- {% if grains['os'] == 'FreeBSD' %}
- shell: /usr/local/bin/fish
- {% else %}
- shell: /usr/bin/fish
- {% endif %}
+ shell: fish
uid: 2012
rama:
fullname: Rama
diff --git a/roles/shellserver/users/init.sls b/roles/shellserver/users/init.sls
--- a/roles/shellserver/users/init.sls
+++ b/roles/shellserver/users/init.sls
@@ -19,6 +19,8 @@
#
# -------------------------------------------------------------
+{% from "map.jinja" import shells with context %}
+
# -------------------------------------------------------------
# Disabled accounts
# -------------------------------------------------------------
@@ -36,7 +38,7 @@
{{user}}:
user.present:
- fullname: {{ args['fullname'] }}
- - shell: {{ args['shell']|default('/bin/bash') }}
+ - shell: {{ shells[args['shell']|default('bash')] }}
- uid: {{ args['uid'] }}
{% endfor %}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 25, 12:02 (17 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262236
Default Alt Text
D974.id2593.diff (1 KB)
Attached To
Mode
D974: Map shells by OS
Attached
Detach File
Event Timeline
Log In to Comment