fail when bot user has no emails defined
Summary
When bot user has no emails defined, the role cannot update it.
Steps to reproduce
- Remove emails from bot user
- Run
./execute ENVIRONMENT deploy --tags rocketchat
Expected behavior
everything up and running
Actual behavior
Failure on step "update bot user"
Relevant logs and/or screenshots
fatal: [rocketchat]: FAILED! => {"failed": true, "msg": "The conditional check '_rocketchat_bot_user_from_list.name != rocketchat_bot_display_name or rocketchat_bot_mail not in _rocketchat_bot_user_from_list | json_query('emails[*].address') or _result_rocketchat_bot_login.status == 401' failed. The error was: Unexpected templating type error occurred on ({% if _rocketchat_bot_user_from_list.name != rocketchat_bot_display_name or rocketchat_bot_mail not in _rocketchat_bot_user_from_list | json_query('emails[*].address') or _result_rocketchat_bot_login.status == 401 %} True {% else %} False {% endif %}): argument of type 'NoneType' is not iterable\n\nThe error appears to have been in '/home/bdaca/Praca/ansible-playbooks/teamworm-temp/roles/rocketchat/tasks/deploy.yml': line 111, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name: \"update bot user\"\n ^ here\n"}
Possible fixes
we have to test if the list is not empty