6bd6bf98e5
* Changes as per review comments and renamed file to vmware_content_library_info * Removing password field from publish info dictionary * Removed current password field from publish info * Modified vmware_content_library_info module with review comments. * Review comments. Moved test .yml files under tasks folder * Moved test files under module name folder. Handled library_get call under try catch to throw proper error message * Fixed precheck failure bare except. Catching Exception
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
# Test code for the vmware_content_library_info.
|
|
# Copyright: (c) 2019, Pavan Bidkar <pbidkar@vmware.com>
|
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
- when: vcsim is not defined
|
|
block:
|
|
# Get List of Content Libraries
|
|
- name: Get List of Content Libraries
|
|
vmware_content_library_info:
|
|
hostname: '{{ vcenter_hostname }}'
|
|
username: '{{ vcenter_username }}'
|
|
password: '{{ vcenter_password }}'
|
|
validate_certs: false
|
|
register: content_library_info
|
|
|
|
- set_fact: content_library="{{ content_library_info['content_libs'][0] }}"
|
|
|
|
# Get Details of content library
|
|
- name: Get facts about Content Library
|
|
vmware_content_library_info:
|
|
hostname: '{{ vcenter_hostname }}'
|
|
username: '{{ vcenter_username }}'
|
|
password: '{{ vcenter_password }}'
|
|
library_id: '{{ content_library }}'
|
|
validate_certs: false
|
|
register: content_lib_facts
|
|
|
|
- name: Check Content Library details
|
|
assert:
|
|
that:
|
|
- '{{ content_lib_facts.content_lib_details[0].library_id == content_library }}'
|