Skip to content

Commit

Permalink
Merge pull request dell#776 from dell/integration/minor_enhancements
Browse files Browse the repository at this point in the history
[Integration] - Minor refactoring
  • Loading branch information
rajshekarp87 authored Dec 3, 2024
2 parents 1aef82a + cf87cad commit 54c1a2c
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 63 deletions.
52 changes: 30 additions & 22 deletions tests/integration/inventory.networking
Original file line number Diff line number Diff line change
Expand Up @@ -25,40 +25,48 @@ validate_certs=false
ansible_host=localhost
ansible_connection=local
ansible_become_pass=password
idrac_reset_default_username=default_username
idrac_reset_default_password=default_password
http_share=http_share_ip
http_share_dir_path=http_share_path
http_share_user=http_share_user
http_share_password=http_share_password
idrac_firmware_dup_file=idrac_firmware_dup_file
bios_firmware_dup_file=bios_firmware_dup_file
https_share_ip=https_share_ip
https_share_username=https_share_username
https_share_password=https_share_password
ome_application_certificate_certificate_remote_share_path=remote_share_path
ome_application_certificate_certificate_chain_filename=certificate_chain_filename
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 deatils
nfs_share_name=nfs_share_name
modify_nfs_share_name=""
# CIFS share deatils
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
ftp_share_password=ftp_share_password
socks4_proxy_server=socks4_proxy_server
socks4_proxy_port=socks4_proxy_port
# HTTP share details
http_share=http_share_ip
http_share_dir_path=http_share_path
http_share_user=http_share_user
http_share_password=http_share_password
# Proxy server details
http_proxy_server=http_proxy_server
http_proxy_port=http_proxy_port
http_proxy_username=http_proxy_username
http_proxy_password=http_proxy_password
socks4_proxy_server=socks4_proxy_server
socks4_proxy_port=socks4_proxy_port
# HTTPS share details
https_share_ip=https_share_ip
https_share_username=https_share_username
https_share_password=https_share_password
# FTP share details
ftp_share_ip=ftp_share_ip
ftp_share_dir_path=ftp_share_dir_path
ftp_share_username=ftp_share_username
ftp_share_password=ftp_share_password
# Module specific parameter details
idrac_reset_default_username=default_username
idrac_reset_default_password=default_password
idrac_secure_boot_cert_path_1=secure_boot_certitifate_path_1
idrac_secure_boot_cert_path_2=secure_boot_certitifate_path_1
idrac_firmware_dup_file=idrac_firmware_dup_file
bios_firmware_dup_file=bios_firmware_dup_file
ome_application_certificate_certificate_remote_share_path=remote_share_path
ome_application_certificate_certificate_chain_filename=certificate_chain_filename
ome_application_certificate_local_temp_path=local_temp_path
omevv_baseline_profile_catalog_file=catlog_file_name

#make sure these directories has write permissions
idrac_secure_boot_dir_path_1=secure_boot_dir_path/db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
name: "OMAM_Firm_Repo"
description: "Firmware repository profile created by OMAM"
state: present
catalog_path: "{{
http_share_dir_path }}/omevv_baseline_profile_catalog.xml"
catalog_path: "http://{{ http_share }}{{
http_share_dir_path }}/{{ omevv_baseline_profile_catalog_file }}"
protocol_type: HTTP
register: firm_repo_1
when: repository_profile_1_trigger is defined
Expand All @@ -61,8 +61,8 @@
name: "OMAM_Modify_Firm_Repo"
description: "Firmware repository profile created by OMAM"
state: present
catalog_path: "{{
http_share_dir_path }}/omevv_baseline_profile_catalog.xml"
catalog_path: "http://{{ http_share }}{{
http_share_dir_path }}/{{ omevv_baseline_profile_catalog_file }}"
protocol_type: HTTP
register: firm_repo_2
when: repository_profile_2_trigger is defined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
- module_group_id == group_id
- cm_dm_result_baseline.diff.before.description is none
- >
cm_dm_result_baseline.diff.before.firmwareRepoId
== firmware_repo_id
'cm_dm_result_baseline.diff.before.firmwareRepoId
== "firmware_repo_id"'
- >
'cm_dm_result_baseline.diff.before.firmwareRepoName
== "OMAM_Firm_Repo"'
Expand Down Expand Up @@ -145,8 +145,8 @@
- module_group_id == group_id
- cm_dm_result_baseline.diff.before.description is none
- >
cm_dm_result_baseline.diff.before.firmwareRepoId
== firmware_repo_id
'cm_dm_result_baseline.diff.before.firmwareRepoId
== "firmware_repo_id"'
- >
'cm_dm_result_baseline.diff.before.firmwareRepoName
== "OMAM_Firm_Repo"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@
- not invalid_port_1.changed
- 'invalid_port_1.msg == "Invalid port number. Enter the valid port
number."'
- 'invalid_port_1.error_info.message == "Invalid port number. Enter
the valid port number."'

- name: Negative - invalid port - 2
dellemc.openmanage.omevv_baseline_profile:
Expand All @@ -81,8 +79,6 @@
- not invalid_port_2.changed
- 'invalid_port_2.msg == "Invalid port number. Enter the valid port
number."'
- 'invalid_port_2.error_info.message == "Invalid port number. Enter
the valid port number."'

- name: Negative - unconfigured port
dellemc.openmanage.omevv_baseline_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
- module_group_id_1 == group_id_1
- module_group_id_2 == group_id_2
- >
cm_dm_result_baseline.diff.after.firmwareRepoId
== firmware_repo_id_2
'cm_dm_result_baseline.diff.after.firmwareRepoId
== "firmware_repo_id_2"'
- >
'cm_dm_result_baseline.diff.after.repository_profile
== "OMAM_Modify_Firm_Repo"'
Expand All @@ -112,8 +112,8 @@
== cluster_name_1
- module_group_id_1 == group_id_1
- >
cm_dm_result_baseline.diff.before.firmwareRepoId
== firmware_repo_id_1
'cm_dm_result_baseline.diff.before.firmwareRepoId
== "firmware_repo_id_1"'
- >
'cm_dm_result_baseline.diff.before.repository_profile
== "OMAM_Firm_Repo"'
Expand All @@ -130,10 +130,7 @@
- name: Set prerequisite
ansible.builtin.include_tasks: _helper.yml
vars:
repository_profile_1_trigger: 1
repository_profile_2_trigger: 1
fetch_cluster_trigger: 1
baseline_trigger: 1

- name: Modify a baseline profile (Normal mode)
dellemc.openmanage.omevv_baseline_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
- ' type: str'
- ''
- = hostname
- ' OpenManage Enterprise or OpenManage Enterprise Modular IP'
- ' address or hostname.'
- ' IP address or hostname of the OpenManage Enterprise Modular.'
- ' type: str'
- ''
- '- name'
Expand Down Expand Up @@ -101,26 +100,28 @@
- ' type: bool'
- ''
- '- vcenter_password'
- ' OpenManage Enterprise Integration for VMware vCenter password.'
- ' Password for OpenManage Enterprise Integration for VMware'
- ' vCenter (OMEVV).'
- ' If the password is not provided, then the environment variable'
- ' `OMEVV_VCENTER_PASSWORD'' is used.'
- ' Example: export OMEVV_VCENTER_PASSWORD=password'
- ' default: null'
- ' type: str'
- ''
- '- vcenter_username'
- ' OpenManage Enterprise Integration for VMware vCenter username.'
- ' Username for OpenManage Enterprise Integration for VMware'
- ' vCenter (OMEVV).'
- ' If the username is not provided, then the environment variable'
- ' `OMEVV_VCENTER_USERNAME'' is used.'
- ' Example: export OMEVV_VCENTER_USERNAME=username'
- ' default: null'
- ' type: str'
- ''
- '- vcenter_uuid'
- ' Universally unique identifier (uuid) of vCenter.'
- ' vCenter uuid details can be fetched using'
- ' Universally Unique Identifier (UUID) of vCenter.'
- ' vCenter UUID details can be retrieved using'
- ' [dellemc.openmanage.omevv_vcenter_info] module.'
- ' If the uuid is not provided, then the environment variable'
- ' If UUID is not provided, then the environment variable'
- ' `OMEVV_VCENTER_UUID'' is used.'
- ' Example: export OMEVV_VCENTER_UUID=uuid'
- ' default: null'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
state: absent
name: "Profile Name"
register: invalid_port
ignore_unreachable: true
ignore_errors: true

- name: Verify task status - Negative - invalid port
ansible.builtin.assert:
that:
- invalid_port.unreachable
- invalid_port.failed
- not invalid_port.changed
- ('invalid_port.msg == "<urlopen error [Errno 111] Connection
refused>"') or ('invalid_port.msg == "<urlopen error timed out>"')
- 'invalid_port.msg == "Invalid port number. Enter the valid port
number."'

- name: Negative - invalid username
dellemc.openmanage.omevv_firmware_repository_profile:
Expand Down Expand Up @@ -166,7 +166,8 @@
that:
- invalid_timeout_value.failed
- not invalid_timeout_value.changed
- 'invalid_timeout_value.msg == "Timeout value out of range"'
- 'invalid_timeout_value.msg == "Invalid timeout value. Enter the
valid positive integer."'

- name: Negative - invalid vcenter uuid
dellemc.openmanage.omevv_firmware_repository_profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
vcenter_password: "{{ vcenter_password }}"
state: "{{ state }}"
protocol_type: "{{ protocol }}"
catalog_path: "{{ path }}"
catalog_path: "http://{{ http_share }}{{
http_share_dir_path }}/{{ omevv_baseline_profile_catalog_file }}"
name: "{{ profile_name }}"
validate_certs: false
description: "Firmware repository profile created by Module"
register: create_result
no_log: true
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,15 @@
always:
- name: Cleanup
dellemc.openmanage.omevv_firmware_repository_profile:
validate_certs: "{{ validate_certs }}"
hostname: "{{ hostname }}"
vcenter_username: "{{ vcenter_username }}"
vcenter_password: "{{ vcenter_password }}"
port: "{{ port }}"
vcenter_uuid: "{{ uuid }}"
name: "temp_profile"
state: absent
ignore_errors: true
no_log: true

module_defaults:
dellemc.openmanage.omevv_firmware_repository_profile_info:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
- ' type: str'
- ''
- = hostname
- ' OpenManage Enterprise or OpenManage Enterprise Modular IP'
- ' address or hostname.'
- ' IP address or hostname of the OpenManage Enterprise Modular.'
- ' type: str'
- ''
- '- name'
Expand Down Expand Up @@ -101,26 +100,28 @@
- ' type: bool'
- ''
- '- vcenter_password'
- ' OpenManage Enterprise Integration for VMware vCenter password.'
- ' Password for OpenManage Enterprise Integration for VMware'
- ' vCenter (OMEVV).'
- ' If the password is not provided, then the environment variable'
- ' `OMEVV_VCENTER_PASSWORD'' is used.'
- ' Example: export OMEVV_VCENTER_PASSWORD=password'
- ' default: null'
- ' type: str'
- ''
- '- vcenter_username'
- ' OpenManage Enterprise Integration for VMware vCenter username.'
- ' Username for OpenManage Enterprise Integration for VMware'
- ' vCenter (OMEVV).'
- ' If the username is not provided, then the environment variable'
- ' `OMEVV_VCENTER_USERNAME'' is used.'
- ' Example: export OMEVV_VCENTER_USERNAME=username'
- ' default: null'
- ' type: str'
- ''
- '- vcenter_uuid'
- ' Universally unique identifier (uuid) of vCenter.'
- ' vCenter uuid details can be fetched using'
- ' Universally Unique Identifier (UUID) of vCenter.'
- ' vCenter UUID details can be retrieved using'
- ' [dellemc.openmanage.omevv_vcenter_info] module.'
- ' If the uuid is not provided, then the environment variable'
- ' If UUID is not provided, then the environment variable'
- ' `OMEVV_VCENTER_UUID'' is used.'
- ' Example: export OMEVV_VCENTER_UUID=uuid'
- ' default: null'
Expand Down

0 comments on commit 54c1a2c

Please sign in to comment.