[stable-2.7] Fix STS assume role error message when role does not exist (#63249)

AWS appears to have changed this error message again.
Fixes https://app.shippable.com/github/ansible/ansible/runs/145643/115/tests
(cherry picked from commit ce402f003f)

Co-authored-by: Jill R <4121322+jillr@users.noreply.github.com>
This commit is contained in:
Jill R 2019-10-09 14:08:29 -07:00 committed by Toshio Kuratomi
parent 40618d70e6
commit b65984981f

View file

@ -290,14 +290,14 @@
assert:
that:
- 'result.failed'
- "'Access denied' in result.msg"
- "'is not authorized to perform: sts:AssumeRole' in result.msg"
when: result.module_stderr is not defined
- name: assert assume not existing sts role
assert:
that:
- 'result.failed'
- "'Access denied' in result.module_stderr"
- "'is not authorized to perform: sts:AssumeRole' in result.msg"
when: result.module_stderr is defined
# ============================================================