Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[integration][omevv_firmware_repository_profile]: Enhancement of testcases and pre-requisite #764

4 changes: 4 additions & 0 deletions tests/integration/inventory.networking
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ ome_application_certificate_local_temp_path=local_temp_path
idrac_secure_boot_cert_path_1=secure_boot_certitifate_path_1
idrac_secure_boot_cert_path_2=secure_boot_certitifate_path_1
nfs_share_name=nfs_share_name
modify_nfs_share_name=""
cifs_share_name=cifs_share_name
cifs_share_user=cifs_share_user
cifs_share_password=cifs_share_password
modify_cifs_share_name=""
modify_cifs_share_user=""
modify_cifs_share_password=""
ftp_share_ip=ftp_share_ip
ftp_share_dir_path=ftp_share_dir_path
ftp_share_username=ftp_share_username
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
---
- name: Creating firmware repository profile
dellemc.openmanage.omevv_firmware_repository_profile:
name: "{{ name }}"
state: present
catalog_path: "{{ first_path }}"
protocol_type: "{{ protocol }}"
share_username: "{{ first_share__username | default(omit) }}"
share_password: "{{ first_share__password | default(omit) }}"
share_domain: ""
description: "FW repo description"

- name: Modifying firmware repository profile based on protocol type- Check Mode
dellemc.openmanage.omevv_firmware_repository_profile: &firm1
name: "Update_Ansible_FirmRepo"
name: "Ansible_Repo_Modify_{{ protocol }}"
state: present
catalog_path: "{{ path }}"
catalog_path: "{{ second_path }}"
protocol_type: "{{ protocol }}"
share_username: "{{ share__username | default(omit) }}"
share_password: "{{ share__password | default(omit) }}"
share_username: "{{ second_share__username | default(omit) }}"
share_password: "{{ second_share__password | default(omit) }}"
share_domain: ""
check_mode: true
register: check_firm_repo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
state: absent
ignore_errors: true
loop: "{{ payload }}"
no_log: true

module_defaults:
dellemc.openmanage.omevv_firmware_repository_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- block:
- name: Creating firmware repository profile
dellemc.openmanage.omevv_firmware_repository_profile:
name: "Ansible_FirmRepo"
name: "Ansible_Repo_Modify_HTTPS"
state: present
catalog_path: "{{ https_share_ip }}"
protocol_type: "HTTPS"
Expand All @@ -24,8 +24,8 @@
- name: Modifying firm repo profile with new name and description -
Check Mode
dellemc.openmanage.omevv_firmware_repository_profile: &mod1
name: "Ansible_FirmRepo"
new_name: "Update_Ansible_FirmRepo"
name: "Ansible_Repo_Modify_HTTPS"
new_name: "Upd_Ansible_Repo_Modify_HTTPS"
description: "New description"
state: present
register: modify_1_check
Expand Down Expand Up @@ -70,18 +70,40 @@
- modify_1_normal_and_diff.diff.after | length == 2
- modify_1_normal_and_diff.diff.before | length == 2

- name: Cleanup after modification of new name and description
dellemc.openmanage.omevv_firmware_repository_profile:
name: "Upd_Ansible_Repo_Modify_HTTPS"
state: absent
ignore_errors: true

- name: Including task for modification based on protocol type
ansible.builtin.include_tasks: __helper_modify.yml
vars:
name: "Ansible_Repo_Modify_{{ item.protocol }}"
protocol: "{{ item.protocol }}"
path: "{{ item.path }}"
share__username: "{{ item.username }}"
share__password: "{{ item.password }}"
first_path: "{{ item.first_path }}"
first_share__username: "{{ item.first_username }}"
first_share__password: "{{ item.first_password }}"
second_path: "{{ item.second_path }}"
second_share__username: "{{ item.second_username }}"
second_share__password: "{{ item.second_password }}"
loop:
- protocol: "HTTPS"
path: "https://downloads.dell.com/catalog/catalog.xml.gz"
username: ""
password: ""
first_path: "{{ https_share_ip }}"
second_path: "https://downloads.dell.com/catalog/catalog.xml.gz"
- protocol: "HTTP"
first_path: "{{ http_share }}{{ http_share_dir_path }}"
second_path: "http://downloads.dell.com/catalog/catalog.xml.gz"
- protocol: "CIFS"
first_path: "{{ cifs_share_name }}"
second_path: "{{ modify_cifs_share_name }}"
first_username: "{{ cifs_share_user }}"
second_username: "{{ modify_cifs_share_user }}"
first_password: "{{ cifs_share_password }}"
second_password: "{{ modify_cifs_share_password }}"
- protocol: "NFS"
first_path: "{{ nfs_share_name }}"
second_path: "{{ modify_nfs_share_name }}"

always:
- name: Cleanup
Expand All @@ -90,9 +112,11 @@
state: absent
ignore_errors: true
loop:
- "Ansible_FirmRepo"
- "Update_Ansible_FirmRepo"
no_log: true
- "Ansible_Repo_Modify_HTTPS"
- "Ansible_Repo_Modify_HTTP"
- "Ansible_Repo_Modify_NFS"
- "Ansible_Repo_Modify_CIFS"
- "Upd_Ansible_Repo_Modify_HTTPS"

module_defaults:
dellemc.openmanage.omevv_firmware_repository_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
timeout: 300
status_code:
- 201
body: "{{ payload }}"
when: get_vcenter_plugin.json | length == 0
vars:
payload:
Expand All @@ -56,8 +57,4 @@
- name: Set fact of uuid
ansible.builtin.set_fact:
uuid: "{{ console_details.json[0].uuid }}"
vcenter_hostname: "{{ console_details.json[0].consoleAddress }}"

- name: Set fact of consoleAddress
ansible.builtin.set_fact:
vcenter_hostname: "{{ console_details.json[0].consoleAddress }}"
when: vcenter_hostname == console_details.json[0].consoleAddress
Loading