mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
vmware: test-refactoring
- In order to keep the integration with `ansible-test`, we prefer to avoid any interaction with the Ansible inventory file. - split up the prepare_vmware_tests/defaults/main.yml in two configuration files: one for vcsim and one for a real environment - remove all the access to hostvars - directly interact with the ESXi to mount/umount the datastore https://github.com/ansible/ansible/pull/56516 - record the virtual machine folder in the environment configuration - vmware_guest_move: Use https://github.com/ansible/ansible/pull/55237
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
- import_role:
|
||||
name: prepare_vmware_tests
|
||||
vars:
|
||||
setup_datacenter: true
|
||||
|
||||
- &dvs_data
|
||||
name: Add distributed vSwitch
|
||||
@@ -26,13 +28,26 @@
|
||||
that:
|
||||
- dvs_result_0001.changed
|
||||
|
||||
- name: Create a VM folder on given Datacenter
|
||||
vcenter_folder:
|
||||
hostname: '{{ vcenter_hostname }}'
|
||||
username: '{{ vcenter_username }}'
|
||||
password: '{{ vcenter_password }}'
|
||||
datacenter: '{{ dc1 }}'
|
||||
folder_name: network_folder
|
||||
folder_type: network
|
||||
state: present
|
||||
validate_certs: no
|
||||
register:
|
||||
network_folder_result
|
||||
|
||||
- name: Add distributed vSwitch using folder
|
||||
vmware_dvswitch:
|
||||
validate_certs: False
|
||||
hostname: "{{ vcenter_hostname }}"
|
||||
username: "{{ vcenter_username }}"
|
||||
password: "{{ vcenter_password }}"
|
||||
folder: "/F0/{{ dc1 }}/network/F0"
|
||||
folder: "{{ network_folder_result.result.path }}"
|
||||
state: present
|
||||
switch_name: dvswitch_0002
|
||||
mtu: 9000
|
||||
|
||||
Reference in New Issue
Block a user