Debian Codegraph @

ansible_collections/dellemc/openmanage/roles/redfish_firmware/molecule/firmware_update-10599/converge.yml

raw symbols SCIP
1 ---
2 - name: Converge
3 hosts: all
4 vars:
5 redfish_firmware_image_url_without_reboot: "{{ lookup('env', 'redfish_firmware_image_url_without_reboot') }}"
6 redfish_firmware_image_url_need_reboot: "{{ lookup('env', 'redfish_firmware_image_url_need_reboot') }}"
7 redfish_firmware_image_local_path: "{{ lookup('env', 'redfish_firmware_image_local_path') }}"
8 gather_facts: false
9 tasks:
10 - name: Checking if HTTP url is empty
11 ansible.builtin.fail:
12 msg: Please provide HTTP url for redfish_firmware in molecule.yml
13 when: redfish_firmware_image_url_without_reboot == "" and redfish_firmware_image_url_need_reboot == ""
14
15 - name: Downloading firmware image for local manual reboot
16 ansible.builtin.get_url:
17 url: "{{ redfish_firmware_image_url_need_reboot }}"
18 dest: "{{ redfish_firmware_image_local_path }}"
19 mode: "0755"
20 delegate_to: localhost
21
22 - name: Initializing idrac common inputs to use as aliases
23 ansible.builtin.set_fact:
24 common_input: &idrac_input
25 hostname: "{{ lookup('env', 'IDRAC_IP') }}"
26 username: "{{ lookup('env', 'IDRAC_USER') }}"
27 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
28 validate_certs: false
29 no_log: true
30
31 - name: TC - 001 - Provide valid HTTP image_uri with default transfer_protocol with auto reboot
32 ansible.builtin.import_role:
33 name: redfish_firmware
34 vars:
35 <<: *idrac_input
36 image_uri: "{{ redfish_firmware_image_url_without_reboot }}"
37 job_wait_timeout: 3600
38
39 - name: TC - 001 - Asserting after performing update with valid image_uri and default transfter_protocol with auto reboot
40 ansible.builtin.assert:
41 that:
42 - redfish_firmware_out.msg == 'Successfully updated the firmware.'
43 - redfish_firmware_out.changed
44
45 - name: TC - 002 - Provide valid local image_uri firmware to schedule job with job_wait_timeout 60 secs
46 ansible.builtin.import_role:
47 name: redfish_firmware
48 vars:
49 <<: *idrac_input
50 image_uri: "{{ redfish_firmware_image_url_need_reboot }}"
51 job_wait_timeout: 60
52
53 - name: TC - 002 - Asserting after performing update with local image_uri firmware to schedule job
54 ansible.builtin.assert:
55 that:
56 - redfish_firmware_out.msg == "Successfully scheduled the firmware job."
57 - redfish_firmware_out.changed
58
59 - name: TC - 002 - Deleting the schedule job in iDRAC
60 ansible.builtin.uri:
61 url: "https://{{ lookup('env', 'IDRAC_IP') }}/redfish/v1/JobService/Jobs/{{ redfish_firmware_out.task.id }}"
62 validate_certs: false
63 method: "DELETE"
64 user: "{{ lookup('env', 'IDRAC_USER') }}"
65 password: "{{ lookup('env', 'IDRAC_PASSWORD') }}"
66 headers:
67 Accept: "application/json"
68 Content-Type: "application/json"
69 OData-Version: "4.0"
70 body_format: "json"
71 status_code:
72 - 200
73 return_content: true
74 no_log: true