Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_user/molecule/modify_all_params-10643/converge.yml

raw symbols SCIP
1 ---
2 - name: Validate modifying a user with all parameters
3 hosts: all
4 gather_facts: false
5 vars:
6 idrac_user_name: "moleculeTest"
7 idem_msg: "Requested changes are already present in the user slot."
8 tasks:
9 - name: Get Server generation
10 ansible.builtin.include_tasks:
11 file: ../resources/idrac_user/_get_server_generation.yml
12
13 - name: Setting up protocol dynamically
14 ansible.builtin.set_fact:
15 ap: "{{ 'SHA' if model | int < 17 else 'SHA-384' }}"
16 pp: "{{ 'AES' if model | int < 17 else 'AES-256' }}"
17 no_log: true
18
19 - name: Modify iDRAC user with all parameters
20 ansible.builtin.import_role:
21 name: dellemc.openmanage.idrac_user
22 vars:
23 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
24 username: "{{ lookup('env', 'IDRAC_USER') }}"
25 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
26 validate_certs: false
27 state: present
28 user_name: "{{ idrac_user_name }}"
29 privilege: Operator
30 ipmi_lan_privilege: User
31 ipmi_serial_privilege: User
32 enable: true
33 sol_enable: true
34 protocol_enable: true
35 authentication_protocol: "{{ ap }}"
36 privacy_protocol: "{{ pp }}"
37
38 - name: Asserting user creation in check mode
39 ansible.builtin.assert:
40 that: idrac_user_out.msg == "Changes found to commit!"
41 when: ansible_check_mode
42 tags: molecule-idempotence-notest
43
44 - name: Fetching user info in normal mode
45 ansible.builtin.include_tasks:
46 file: ../resources/idrac_user/get_user_info.yml
47 when: not ansible_check_mode and idrac_user_out.changed
48 tags: molecule-idempotence-notest
49
50 - name: Asserting user creation in normal mode
51 ansible.builtin.assert:
52 that:
53 - idrac_user_out.msg == "Successfully updated user account."
54 - "{{ (user_details.user_info | length) != 0 }}"
55 - user_details.user_info[0].UserName == idrac_user_account.UserName
56 - user_details.user_info[0].RoleId == "Operator"
57 when: not ansible_check_mode and idrac_user_out.changed
58 tags: molecule-idempotence-notest
59
60 - name: Asserting user creation in Idempotency mode
61 ansible.builtin.assert:
62 that:
63 - idrac_user_out.msg == idem_msg
64 when: not ansible_check_mode and not idrac_user_out.changed