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

Commit

Permalink
Switch to failed_when structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Shapiro committed Nov 28, 2016
1 parent 4f6eff2 commit 0300988
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions playbooks/edx-east/manage_edxapp_users_and_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,4 @@
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
failed_when: (manage_users_result | failed) and not (ignore_user_creation_errors | bool)

0 comments on commit 0300988

Please sign in to comment.