Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Merge pull request #3398 from open-craft/haikuginger/allow-user-provi…
Browse files Browse the repository at this point in the history
…sioning-failures

Optionally allow user provisioning failures
  • Loading branch information
haikuginger authored Nov 30, 2016
2 parents b92c0b0 + 102c731 commit 7628a31
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions playbooks/edx-east/manage_edxapp_users_and_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,20 @@
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 %}
with_items: django_groups

- 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 %}
Expand All @@ -97,3 +99,5 @@
{% 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
register: manage_users_result
failed_when: (manage_users_result | failed) and not (ignore_user_creation_errors | bool)

0 comments on commit 7628a31

Please sign in to comment.