{"action":"created","issue":{"url":"https://api.github.com/repos/edx/configuration/issues/3398","repository_url":"https://api.github.com/repos/edx/configuration","labels_url":"https://api.github.com/repos/edx/configuration/issues/3398/labels{/name}","comments_url":"https://api.github.com/repos/edx/configuration/issues/3398/comments","events_url":"https://api.github.com/repos/edx/configuration/issues/3398/events","html_url":"https://github.com/edx/configuration/pull/3398","id":179812651,"number":3398,"title":"Optionally allow user provisioning failures","user":{"login":"haikuginger","id":7773758,"avatar_url":"https://avatars.githubusercontent.com/u/7773758?v=3","gravatar_id":"","url":"https://api.github.com/users/haikuginger","html_url":"https://github.com/haikuginger","followers_url":"https://api.github.com/users/haikuginger/followers","following_url":"https://api.github.com/users/haikuginger/following{/other_user}","gists_url":"https://api.github.com/users/haikuginger/gists{/gist_id}","starred_url":"https://api.github.com/users/haikuginger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haikuginger/subscriptions","organizations_url":"https://api.github.com/users/haikuginger/orgs","repos_url":"https://api.github.com/users/haikuginger/repos","events_url":"https://api.github.com/users/haikuginger/events{/privacy}","received_events_url":"https://api.github.com/users/haikuginger/received_events","type":"User","site_admin":false},"labels":[{"id":128412909,"url":"https://api.github.com/repos/edx/configuration/labels/awaiting%20prioritization","name":"awaiting prioritization","color":"fad8c7","default":false},{"id":99580727,"url":"https://api.github.com/repos/edx/configuration/labels/open-source-contribution","name":"open-source-contribution","color":"bfe5bf","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-09-28T15:52:13Z","updated_at":"2016-11-15T19:22:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/configuration/pulls/3398","html_url":"https://github.com/edx/configuration/pull/3398","diff_url":"https://github.com/edx/configuration/pull/3398.diff","patch_url":"https://github.com/edx/configuration/pull/3398.patch"},"body":"When using the user management playbook in the context of an OpenEdX instance with persistent databases stored on another server, we discovered that we may run into errors when managing users if the user's email address has been changed since the initial provisioning. Since this is expected, we'd like to optionally set a variable while provisioning that determines whether we fail at provisioning if user account creation fails.\n\nIn other words, if we have a persistent database that has previously been fully provisioned, then a failure of the management command is likely due to an acceptable reason, and we can safely ignore it.\n\n**Dependencies**: None\n\n**Partner information**: 3rd party-hosted open edX instance\n\n**Testing instructions**:\n1. On a devstack, pull this version of configuration.\n2. Run the following command:\n   \n   `ansible-playbook -i \"localhost,\" manage_edxapp_users_and_groups.yml --extra-vars '{\"django_users\":[{\"username\":\"staff\",\"email\":\"fake-staff@example.com\"}, {\"username\":\"honor\",\"email\":\"honor@example.com\"}], \"django_groups\":[], \"deployment_settings\":\"devstack\"}' -c local`\n3. Observe that the playbook fails (ends with the message: \"FATAL: all hosts have already failed -- aborting\").\n4. Run the following command:\n   \n   `ansible-playbook -i \"localhost,\" manage_edxapp_users_and_groups.yml --extra-vars '{\"django_users\":[{\"username\":\"staff\",\"email\":\"fake-staff@example.com\"}, {\"username\":\"honor\",\"email\":\"honor@example.com\"}], \"django_groups\":[], \"deployment_settings\":\"devstack\", \"ignore_user_creation_errors\":\"yes\"}' -c local`\n5. Observe that there is an \"...ignoring\" note under the failed play, and that the final report does not show any failures.\n\n**Author notes and concerns**:\n1. The previous version of the playbook was statically tied to `settings=aws`. To make testing this change in a devstack feasible, it was necessary to add a variable to change that to have an arbitrary value (e.g., `settings=devstack` or `settings=openstack`).\n2. While it would have been nice to simply set a variable in `ignore_errors` on a single play, this does not appear to be possible with the current version of Ansible. As a result, it was necessary to create an additional play that fails if the user creation play failed AND `ignore_user_creation_errors` isn't True.\n\n**Reviewers**\n- [ ] @pomegranited \n- [ ] edX reviewer[s] TBD\n"},"comment":{"url":"https://api.github.com/repos/edx/configuration/issues/comments/260739653","html_url":"https://github.com/edx/configuration/pull/3398#issuecomment-260739653","issue_url":"https://api.github.com/repos/edx/configuration/issues/3398","id":260739653,"user":{"login":"maxrothman","id":2607086,"avatar_url":"https://avatars.githubusercontent.com/u/2607086?v=3","gravatar_id":"","url":"https://api.github.com/users/maxrothman","html_url":"https://github.com/maxrothman","followers_url":"https://api.github.com/users/maxrothman/followers","following_url":"https://api.github.com/users/maxrothman/following{/other_user}","gists_url":"https://api.github.com/users/maxrothman/gists{/gist_id}","starred_url":"https://api.github.com/users/maxrothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxrothman/subscriptions","organizations_url":"https://api.github.com/users/maxrothman/orgs","repos_url":"https://api.github.com/users/maxrothman/repos","events_url":"https://api.github.com/users/maxrothman/events{/privacy}","received_events_url":"https://api.github.com/users/maxrothman/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T19:22:36Z","updated_at":"2016-11-15T19:22:36Z","body":"Out of curiosity, have you tested a combination of `register` and `failed_when` rather than `ignore_errors` and a separate task?"}}
{"actor":{"display_login":"maxrothman"}}