Debian Codegraph @

ansible_collections/amazon/aws/tests/integration/targets/iam_user/tasks/password.yml

raw
1 ---
2 # ------------------------------------------------------------------------------------------
3 ## Test user password update
4 - name: Test update IAM password with on_create only (check mode)
5 amazon.aws.iam_user:
6 name: "{{ test_user3 }}"
7 password: "{{ test_new_password }}"
8 update_password: on_create
9 state: present
10 register: iam_user_update
11 check_mode: true
12 - name: Assert no change
13 ansible.builtin.assert:
14 that:
15 - iam_user_update is not changed
16
17 - name: Test update IAM password with on_create only
18 amazon.aws.iam_user:
19 name: "{{ test_user3 }}"
20 password: "{{ test_new_password }}"
21 update_password: on_create
22 state: present
23 register: iam_user_update
24 - name: Assert no change
25 ansible.builtin.assert:
26 that:
27 - iam_user_update is not changed
28
29 - name: Update IAM password (check mode)
30 amazon.aws.iam_user:
31 name: "{{ test_user3 }}"
32 password: "{{ test_new_password }}"
33 state: present
34 register: iam_user_update
35 check_mode: true
36 - name: Assert would change
37 ansible.builtin.assert:
38 that:
39 - iam_user_update is changed
40
41 # flakey, there is no waiter for login profiles
42 # Login Profile for User ansible-user-c cannot be modified while login profile is being created.
43 - name: Update IAM password
44 amazon.aws.iam_user:
45 name: "{{ test_user3 }}"
46 password: "{{ test_new_password }}"
47 state: present
48 register: iam_user_update
49 until: iam_user_update.failed == false
50 delay: 3
51 retries: 5
52 - name: Assert change
53 ansible.builtin.assert:
54 that:
55 - iam_user_update is changed
56 - iam_user_update.user.user_name == test_user3