Page MenuHomeDevCentral

No OneTemporary

diff --git a/pillar/users/shellusers.sls b/pillar/users/shellusers.sls
index e5975d0..917564a 100644
--- a/pillar/users/shellusers.sls
+++ b/pillar/users/shellusers.sls
@@ -1,40 +1,45 @@
# -------------------------------------------------------------
# Salt — Users accounts list
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-04-08
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Users accounts
# -------------------------------------------------------------
shellusers:
tomjerr:
fullname: Tommy Aditya
uid: 2001
erol:
fullname: Erol Unutmaz
uid: 2002
rashk0:
fullname: Rashk0
uid: 2003
kazuya:
fullname: Kazuya
uid: 2004
amj:
fullname: Amaury J.
uid: 2005
dereckson:
fullname: Sebastien Santoro
+ {% if grains['os'] == 'FreeBSD' %}
+ shell: /bin/tcsh
+ {% else %}
+ shell: /usr/bin/tcsh
+ {% endif %}
uid: 5001
kalix:
fullname: Yassine Hadj Messaoud
uid: 5002
shark:
fullname: Shark
uid: 2006
rix:
fullname: Rix
uid: 2007
diff --git a/roles/shellserver/users/init.sls b/roles/shellserver/users/init.sls
index d62fc7d..17fcabb 100644
--- a/roles/shellserver/users/init.sls
+++ b/roles/shellserver/users/init.sls
@@ -1,82 +1,82 @@
# -------------------------------------------------------------
# Salt — Provision users accounts
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Eglide
# Created: 2016-04-08
# Description: Adds and revokes user accounts, in the relevant
# groups and with their stable SSH keys.
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Table of contents
# -------------------------------------------------------------
#
# :: Disabled accounts
#  :: Active accounts
#  :: Groups
# :: Managed SSH keys
#
# -------------------------------------------------------------
# -------------------------------------------------------------
# Disabled accounts
# -------------------------------------------------------------
{% for user in pillar.get('revokedusers') %}
{{user}}:
user.absent
{% endfor %}
# -------------------------------------------------------------
# Active accounts
# -------------------------------------------------------------
{% for user, args in pillar.get('shellusers', {}).iteritems() %}
{{user}}:
user.present:
- fullname: {{ args['fullname'] }}
- - shell: /bin/bash
+ - shell: {{ args['shell']|default('/bin/bash') }}
- uid: {{ args['uid'] }}
{% endfor %}
# -------------------------------------------------------------
# Groups
# -------------------------------------------------------------
shell:
group.present:
- system: True
- gid: 200
- members:
{% for user, args in pillar.get('shellusers', {}).iteritems() %}
- {{user}}
{% endfor %}
{% if salt['group.info']('root') and salt['group.info']('root')['gid'] == 0 %}
rename_root_group_to_wheel:
cmd.run:
- name: sed -i 's/root:x:0:/wheel:x:0:/' /etc/group
{% endif %}
wheel:
group.present:
- system: True
- gid: 0
- members:
{% for user in pillar.get('shelladmins') %}
- {{user}}
{% endfor %}
# -------------------------------------------------------------
# Managed SSH keys
# -------------------------------------------------------------
{% for user, args in pillar.get('shellusers', {}).iteritems() %}
sshkey_{{user}}:
ssh_auth.present:
- user: {{user}}
- source: salt://roles/shellserver/users/files/ssh_keys/{{user}}
{% endfor %}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 16:40 (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260573
Default Alt Text
(3 KB)

Event Timeline