Page MenuHomeDevCentral

D974.id2591.diff
No OneTemporary

D974.id2591.diff

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

Mime Type
text/plain
Expires
Mon, Nov 25, 11:11 (17 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2262236
Default Alt Text
D974.id2591.diff (1 KB)

Event Timeline