| 1 |
--- |
| 2 |
- name: Converge idrac_firmware for https share via proxy |
| 3 |
hosts: all |
| 4 |
gather_facts: false |
| 5 |
tasks: |
| 6 |
- name: Update firmware from repository on a HTTPS via parameter proxy Share |
| 7 |
ansible.builtin.import_role: |
| 8 |
name: dellemc.openmanage.idrac_firmware |
| 9 |
vars: |
| 10 |
hostname: "{{ lookup('env', 'IDRAC_IP') }}" |
| 11 |
username: "{{ lookup('env', 'IDRAC_USER') }}" |
| 12 |
password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" |
| 13 |
validate_certs: false |
| 14 |
share_name: "{{ lookup('env', 'httpsproxy') }}" |
| 15 |
share_user: "{{ lookup('env', 'shareuser') }}" |
| 16 |
share_password: "{{ lookup('env', 'sharepassword') }}" |
| 17 |
reboot: true |
| 18 |
job_wait: true |
| 19 |
apply_update: true |
| 20 |
proxy_support: "ParametersProxy" |
| 21 |
proxy_server: "{{ lookup('env', 'proxyserver') }}" |
| 22 |
proxy_type: "HTTP" |
| 23 |
proxy_port: "{{ lookup('env', 'proxy_port') }}" |
| 24 |
proxy_uname: "{{ lookup('env', 'proxy_username') }}" |
| 25 |
proxy_passwd: "{{ lookup('env', 'proxy_password') }}" |
| 26 |
catalog_file_name: "{{ lookup('env', 'catalog_file_name') }}" |
| 27 |
|
| 28 |
- name: "Waiting for idrac to be reachable (first wait)" |
| 29 |
ansible.builtin.include_tasks: |
| 30 |
file: "../resources/_wait_for_port_to_open.yaml" |
| 31 |
when: not ansible_check_mode |
| 32 |
tags: molecule-idempotence-notest |
| 33 |
|
| 34 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy share in check mode" |
| 35 |
ansible.builtin.assert: |
| 36 |
that: idrac_firmware_out.msg == "Changes found to commit!" |
| 37 |
when: ansible_check_mode |
| 38 |
tags: molecule-idempotence-notest |
| 39 |
|
| 40 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy share in normal mode" |
| 41 |
ansible.builtin.assert: |
| 42 |
that: |
| 43 |
- idrac_firmware_out.msg == "Successfully updated the firmware." |
| 44 |
when: not ansible_check_mode and idrac_firmware_out.changed |
| 45 |
|
| 46 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy share in idempotence mode" |
| 47 |
ansible.builtin.assert: |
| 48 |
that: |
| 49 |
- idrac_firmware_out.msg == "Unable to complete the operation because the catalog name entered has either unsupported firmware packages |
| 50 |
or same version installed on the server." |
| 51 |
when: not ansible_check_mode and not idrac_firmware_out.changed |
| 52 |
|
| 53 |
- name: "Pre-requisites" |
| 54 |
ansible.builtin.include_tasks: |
| 55 |
file: "../resources/tests/downgrade.yml" |
| 56 |
when: not ansible_check_mode |
| 57 |
tags: molecule-idempotence-notest |
| 58 |
|
| 59 |
- name: Update firmware from repository on a HTTPS via default proxy Share |
| 60 |
ansible.builtin.import_role: |
| 61 |
name: dellemc.openmanage.idrac_firmware |
| 62 |
vars: |
| 63 |
hostname: "{{ lookup('env', 'IDRAC_IP') }}" |
| 64 |
username: "{{ lookup('env', 'IDRAC_USER') }}" |
| 65 |
password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" |
| 66 |
share_name: "{{ lookup('env', 'httpsproxy') }}" |
| 67 |
share_user: "{{ lookup('env', 'shareuser') }}" |
| 68 |
share_password: "{{ lookup('env', 'sharepassword') }}" |
| 69 |
validate_certs: false |
| 70 |
reboot: true |
| 71 |
job_wait: true |
| 72 |
apply_update: true |
| 73 |
proxy_support: "DefaultProxy" |
| 74 |
catalog_file_name: "{{ lookup('env', 'catalog_file_name') }}" |
| 75 |
|
| 76 |
- name: "Waiting for idrac to be reachable (second wait)" |
| 77 |
ansible.builtin.include_tasks: |
| 78 |
file: "../resources/_wait_for_port_to_open.yaml" |
| 79 |
when: not ansible_check_mode |
| 80 |
tags: molecule-idempotence-notest |
| 81 |
|
| 82 |
- name: "Verifying update firmware from repository on a HTTPS via default proxy share in check mode" |
| 83 |
ansible.builtin.assert: |
| 84 |
that: idrac_firmware_out.msg == "Changes found to commit!" |
| 85 |
when: ansible_check_mode |
| 86 |
tags: molecule-idempotence-notest |
| 87 |
|
| 88 |
- name: "Verifying update firmware from repository on a HTTPS via default proxy share in normal mode" |
| 89 |
ansible.builtin.assert: |
| 90 |
that: |
| 91 |
- idrac_firmware_out.msg == "Successfully updated the firmware." |
| 92 |
when: not ansible_check_mode and idrac_firmware_out.changed |
| 93 |
|
| 94 |
- name: "Verifying update firmware from repository on a HTTPS via default proxy share in idempotence mode" |
| 95 |
ansible.builtin.assert: |
| 96 |
that: |
| 97 |
- idrac_firmware_out.msg == "Unable to complete the operation because the catalog name entered has either unsupported firmware packages |
| 98 |
or same version installed on the server." |
| 99 |
when: not ansible_check_mode and not idrac_firmware_out.changed |
| 100 |
|
| 101 |
- name: "Pre-requisites." |
| 102 |
ansible.builtin.include_tasks: |
| 103 |
file: "../resources/tests/downgrade.yml" |
| 104 |
when: not ansible_check_mode |
| 105 |
tags: molecule-idempotence-notest |
| 106 |
|
| 107 |
- name: Update firmware from repository on a HTTPS via parameter proxy Share with proxy_type as SOCKS |
| 108 |
ansible.builtin.import_role: |
| 109 |
name: dellemc.openmanage.idrac_firmware |
| 110 |
vars: |
| 111 |
hostname: "{{ lookup('env', 'IDRAC_IP') }}" |
| 112 |
username: "{{ lookup('env', 'IDRAC_USER') }}" |
| 113 |
password: "{{ lookup('env', 'IDRAC_PASSWORD') }}" |
| 114 |
validate_certs: false |
| 115 |
share_name: "{{ lookup('env', 'httpsproxy') }}" |
| 116 |
share_user: "{{ lookup('env', 'shareuser') }}" |
| 117 |
share_password: "{{ lookup('env', 'sharepassword') }}" |
| 118 |
reboot: true |
| 119 |
job_wait: true |
| 120 |
apply_update: true |
| 121 |
proxy_support: "ParametersProxy" |
| 122 |
proxy_server: "{{ lookup('env', 'proxyserversocks') }}" |
| 123 |
proxy_type: "SOCKS" |
| 124 |
proxy_port: "{{ lookup('env', 'proxyserversocks_port') }}" |
| 125 |
catalog_file_name: "{{ lookup('env', 'catalog_file_name') }}" |
| 126 |
|
| 127 |
- name: "Waiting for idrac to be reachable (third wait)" |
| 128 |
ansible.builtin.include_tasks: |
| 129 |
file: "../resources/_wait_for_port_to_open.yaml" |
| 130 |
when: not ansible_check_mode |
| 131 |
tags: molecule-idempotence-notest |
| 132 |
|
| 133 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy with proxy_type as SOCKS share in check mode" |
| 134 |
ansible.builtin.assert: |
| 135 |
that: idrac_firmware_out.msg == "Changes found to commit!" |
| 136 |
when: ansible_check_mode |
| 137 |
tags: molecule-idempotence-notest |
| 138 |
|
| 139 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy with proxy_type as SOCKS share in normal mode" |
| 140 |
ansible.builtin.assert: |
| 141 |
that: |
| 142 |
- idrac_firmware_out.msg == "Successfully updated the firmware." |
| 143 |
when: not ansible_check_mode and idrac_firmware_out.changed |
| 144 |
|
| 145 |
- name: "Verifying update firmware from repository on a HTTPS via parameter proxy share with proxy_type as SOCKS in idempotence mode" |
| 146 |
ansible.builtin.assert: |
| 147 |
that: |
| 148 |
- idrac_firmware_out.msg == "Unable to complete the operation because the catalog name entered has either unsupported firmware packages |
| 149 |
or same version installed on the server." |
| 150 |
when: not ansible_check_mode and not idrac_firmware_out.changed |