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
OpenEdx
configuration
Commits
4a819361
Commit
4a819361
authored
Oct 11, 2016
by
Jesse Shapiro
Committed by
GitHub
Oct 11, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow optional user provisioning failures (#7)
parent
892587b3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
playbooks/edx-east/manage_edxapp_users_and_groups.yml
+18
-2
No files found.
playbooks/edx-east/manage_edxapp_users_and_groups.yml
View file @
4a819361
...
...
@@ -77,10 +77,12 @@
vars
:
python_path
:
/edx/bin/python.edxapp
manage_path
:
/edx/bin/manage.edxapp
ignore_user_creation_errors
:
no
deployment_settings
:
"
{{
EDXAPP_SETTINGS
|
default('aws')
}}"
tasks
:
-
name
:
Manage groups
shell
:
>
{{ python_path }} {{ manage_path }} lms --settings=
aws
{{ python_path }} {{ manage_path }} lms --settings=
{{ deployment_settings }}
manage_group {{ item.name | quote }}
{% if item.get('permissions', []) | length %}--permissions {{ item.permissions | default([]) | map('quote') | join(' ') }}{% endif %}
{% if item.get('remove') %}--remove{% endif %}
...
...
@@ -88,7 +90,7 @@
-
name
:
Manage users
shell
:
>
{{ python_path }} {{ manage_path }} lms --settings=
aws
{{ python_path }} {{ manage_path }} lms --settings=
{{ deployment_settings }}
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 %}
...
...
@@ -97,3 +99,17 @@
{% if item.get('unusable_password') %}--unusable-password{% endif %}
{% if item.get('initial_password_hash') %}--initial-password-hash {{ item.initial_password_hash | quote }}{% endif %}
with_items
:
django_users
ignore_errors
:
yes
register
:
manage_users_result
# Note that we're doing something a bit odd with this play. Unfortunately, it appears that the
# version of Ansible we're using (1.9.3-edx as of October 2016) does not support variable statements
# in the `ignore_errors` field. As a result, we're capturing the result of that play, and using it
# to determine if we execute an explicit `fail` play.
-
name
:
"
Managing
users
fails
on
error
unless
{{
ignore_user_creation_errors
}}"
fail
:
item
when
:
-
item|failed
-
not ignore_user_creation_errors | bool
with_items
:
manage_users_result.results
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