ansible/test/integration/targets/vmware_content_deploy_template/tasks/main.yml
Gonéri Le Bouder 0aa59ce9ab vmware/test: use better name for datastores
In the VMware tests, we call the datastores `ds1` and `ds2`. The first
one is read-only, the second is read-write and can be used to deploy
VMs. The naming convention was not clear enough and source of a lot
confusion and mistake.

We now have two better names:

- ro_datastore, which is ... read-only
- rw_datastore, the one that we can use to deploy new VM.
2019-11-14 16:55:05 -05:00

37 lines
No EOL
1.1 KiB
YAML

# Test code for the deploy VM from content library template.
# 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)
- import_role:
name: prepare_vmware_tests
vars:
setup_datacenter: true
- when: vcsim is not defined
block:
- &deploy_vm_from_content_library_template
vmware_content_deploy_template:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
template: '{{ test_vm_temp }}'
datastore: '{{ rw_datastore }}'
datacenter: '{{ dc1 }}'
folder: '{{ f0 }}'
host: '{{ esx1 }}'
name: 'test_content_deploy_vm'
state: poweredon
validate_certs: false
register: template_deploy
- name: Check VM deployed successfully
assert:
that:
- template_deploy.changed
- <<: *deploy_vm_from_content_library_template
name: Deploy VM from template again
- name: Check VM with same name is deployed
assert:
that:
- not template_deploy.changed