Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F56391893
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/GIDs b/GIDs
new file mode 100644
index 0000000..28138c2
--- /dev/null
+++ b/GIDs
@@ -0,0 +1 @@
+829 nasqueron-irc
diff --git a/pillar/top.sls b/pillar/top.sls
index 8563e37..28adf56 100644
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -1,15 +1,16 @@
# -------------------------------------------------------------
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-04-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
base:
'*':
- core.hostnames
eglide:
- users.revokedusers
- users.shellusers
- users.shelladmins
+ - users.shellgroups
diff --git a/pillar/users/shellgroups.sls b/pillar/users/shellgroups.sls
new file mode 100644
index 0000000..92ef341
--- /dev/null
+++ b/pillar/users/shellgroups.sls
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Salt — Service groups list
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Eglide
+# Created: 2017-01-24
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Nasqueron
+# -------------------------------------------------------------
+
+shellgroups:
+ nasqueron-irc:
+ gid: 829
+ description: Manages IRC bots used for Nasqueron projects
+ members:
+ - dereckson
diff --git a/roles/shellserver/users/init.sls b/roles/shellserver/users/init.sls
index 17fcabb..7cde92f 100644
--- a/roles/shellserver/users/init.sls
+++ b/roles/shellserver/users/init.sls
@@ -1,82 +1,91 @@
# -------------------------------------------------------------
# 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: {{ 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 %}
+{% for group, args in pillar.get('shellgroups', {}).iteritems() %}
+group_{{group}}:
+ group.present:
+ - name: {{group}}
+ - system: False
+ - gid: {{ args['gid'] }}
+ - members: {{ args['members'] }}
+{% 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
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 7, 17:49 (1 w, 17 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4252939
Default Alt Text
(4 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment