2019-07-12 12:20:30 +02:00
|
|
|
# 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:
|
2019-07-24 10:50:23 +02:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: prepare_vmware_tests
|
|
|
|
vars:
|
|
|
|
setup_attach_host: true
|
|
|
|
setup_datastore: true
|
|
|
|
setup_content_library: true
|
|
|
|
|
2019-07-12 12:20:30 +02:00
|
|
|
# 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
|
|
|
|
|
2019-07-24 10:50:23 +02:00
|
|
|
- debug: var=content_library_info
|
2019-07-12 12:20:30 +02:00
|
|
|
- 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
|
2019-08-26 20:45:34 +02:00
|
|
|
register: content_lib_info
|
2019-07-12 12:20:30 +02:00
|
|
|
|
|
|
|
- name: Check Content Library details
|
|
|
|
assert:
|
|
|
|
that:
|
2019-08-26 20:45:34 +02:00
|
|
|
- '{{ content_lib_info.content_lib_details[0].library_id == content_library }}'
|