Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
1b72c46e
Commit
1b72c46e
authored
Mar 29, 2016
by
Max Rothman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add playbook for managing edxapp users
parent
2fea6a16
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
0 deletions
+86
-0
playbooks/edx-east/manage_edxapp_users_and_groups.yml
+86
-0
No files found.
playbooks/edx-east/manage_edxapp_users_and_groups.yml
0 → 100644
View file @
1b72c46e
#
# edX Configuration
#
# github: https://github.com/edx/configuration
# wiki: https://openedx.atlassian.net/wiki/display/OpenOPS
# code style: https://openedx.atlassian.net/wiki/display/OpenOPS/Ansible+Code+Conventions
# license: https://github.com/edx/configuration/blob/master/LICENSE.TXT
#
# Usage: ansible-playbook -i lms-host-1, -e@path/to/configfile
#
# Overview:
# This playbook ensures that the specified users and groups exist in the targeted
# edxapp cluster.
#
# Users have the following properties:
# - username (required, str)
# - email (required, str)
# - groups (optional, list[str])
# - superuser (optional, bool)
# - staff (optional, bool)
# - remove (optional, bool): ensures the user does not exist
#
# Groups can have the following properties:
# - name (required, str)
# - permissions (optional, list[str])
# - remove (optional, bool): ensures the group does not exist
#
# Example:
#
# users:
# - username: bobby
# email: bobby@droptabl.es
# groups: [group1, group2]
# superuser: true
# staff: true
#
# - username: fred
# email: fred@smith
# remove: true
#
# - username: smitty
# email: smitty@werbenmanjens.en
# groups: [group1]
#
# groups:
# - name: group3
# remove: true
#
# - name: group1
# permissions:
# - permission1
# - permission2
#
# - name: group2
# permissions: [permission3]
#
# NB: to get a list of all available permissions, run the following code:
#
# from django.contrib.auth.models import Permission
# for perm in Permission.objects.all():
# print '{}:{}:{}'.format(perm.content_type.app_label, perm.content_type.model, perm.codename)
#
-
hosts
:
all
vars
:
python_path
:
/edx/bin/python.edxapp
manage_path
:
/edx/bin/manage.edxapp
tasks
:
-
name
:
Manage groups
shell
:
>
{{ python_path }} {{ manage_path }} lms --settings=aws
manage_group {{ item.name | quote }}
{% if item.get('permissions', []) | length %}--permissions {{ item.permissions | default([]) | map('quote') | join(' ') }}{% endif %}
{% if item.get('remove') %}--remove{% endif %}
with_items
:
perm_groups
-
name
:
Manage users
shell
:
>
{{ python_path }} {{ manage_path }} lms --settings=aws
manage_user {{ item.username | quote }} {{ item.email | quote }}
{% if item.get('groups', []) | length %}--groups {{ item.groups | default([]) | map('quote') | join(' ') }}{% endif %}
{% if item.get('remove') %}--remove{% endif %}
{% if item.get('superuser') %}--superuser{% endif %}
{% if item.get('staff') %}--staff{% endif %}
with_items
:
users
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment