Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/idrac_bios/molecule/negative_scenarios-10563/converge.yml

raw symbols SCIP
1 ---
2 - name: Converge file for negative scenarios
3 hosts: all
4 gather_facts: false
5 tasks:
6 ########## Below snippet is commented because of Issue: JIT-285533 ########
7 # - name: Perform reset bios with invalid hostname
8 # ansible.builtin.import_role:
9 # name: dellemc.openmanage.idrac_bios
10 # vars:
11 # hostname: "randomHostname"
12 # username: "{{ lookup('env', 'IDRAC_USER') }}"
13 # password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
14 # validate_certs: false
15 # reset_bios: true
16 # ignore_unreachable: true
17
18 # - name: Assert reset bios with invalid hostname
19 # ansible.builtin.assert:
20 # that:
21 # - "'Unable to communicate with iDRAC randomHostname' in
22 # idrac_bios_out.reset_bios.msg"
23 ###########################################################################
24
25 - name: Block to reset bios with invalid username
26 block:
27 - name: Perform reset bios with invalid username
28 ansible.builtin.include_role:
29 name: dellemc.openmanage.idrac_bios
30 vars:
31 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
32 username: "randomusername"
33 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
34 validate_certs: false
35 reset_bios: true
36 clear_pending: false
37 rescue:
38 - name: Verify reset bios with invalid username
39 ansible.builtin.assert:
40 that:
41 - "'HTTP Error 401' in ansible_failed_result.msg"
42
43 - name: Block for clear pending attributes with invalid value
44 block:
45 - name: Clear pending attributes with invalid value
46 ansible.builtin.include_role:
47 name: dellemc.openmanage.idrac_bios
48 vars:
49 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
50 username: "{{ lookup('env', 'IDRAC_USER') }}"
51 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
52 validate_certs: false
53 clear_pending: yess
54 rescue:
55 - name: Assert clear pending attributes with invalid value
56 ansible.builtin.assert:
57 that: ansible_failed_result.msg is
58 search('unable to convert to bool')
59
60 - name: Block for reset bios with invalid value
61 block:
62 - name: Perform reset bios with invalid value
63 ansible.builtin.include_role:
64 name: dellemc.openmanage.idrac_bios
65 vars:
66 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
67 username: "{{ lookup('env', 'IDRAC_USER') }}"
68 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
69 validate_certs: false
70 reset_bios: truee
71 rescue:
72 - name: Assert perform reset bios with invalid value
73 ansible.builtin.assert:
74 that: ansible_failed_result.msg is
75 search('unable to convert to bool')
76
77 - name: Block for reset bios with invalid password
78 block:
79 - name: Perform reset bios with invalid password
80 ansible.builtin.include_role:
81 name: dellemc.openmanage.idrac_bios
82 vars:
83 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
84 username: "{{ lookup('env', 'IDRAC_USER') }}"
85 password: "randompassword"
86 validate_certs: false
87 clear_pending: false
88 reset_bios: true
89 rescue:
90 - name: Assert reset bios with invalid password
91 ansible.builtin.assert:
92 that:
93 - '"HTTP Error 401" in ansible_failed_result.msg or
94 "urlopen error timed out" in ansible_failed_result.msg'
95
96 - name: Block for reset type with invalid value
97 block:
98 - name: Perform reset type with invalid value
99 ansible.builtin.include_role:
100 name: dellemc.openmanage.idrac_bios
101 vars:
102 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
103 username: "{{ lookup('env', 'IDRAC_USER') }}"
104 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
105 validate_certs: false
106 clear_pending: false
107 reset_bios: true
108 reset_type: graceful_restartt
109 rescue:
110 - name: Assert reset type with invalid value
111 ansible.builtin.assert:
112 that:
113 - ansible_failed_result.msg is
114 search('value of reset_type must be one of')
115 - ansible_failed_result.msg is
116 search('graceful_restart, force_restart')
117
118 - name: Clear pending attributes with reset
119 block:
120 - name: Clear pending attributes with reset
121 ansible.builtin.include_role:
122 name: dellemc.openmanage.idrac_bios
123 vars:
124 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
125 username: "{{ lookup('env', 'IDRAC_USER') }}"
126 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
127 validate_certs: false
128 clear_pending: true
129 reset_bios: true
130 rescue:
131 - name: Assert clear pending attributes with reset
132 ansible.builtin.assert:
133 that: "ansible_failed_result.msg is
134 search('clear_pending and reset_bios is mutually exclusive')"