VMware: Add folder option for vmware_dvswitch (#56707)

* Added folder param
* Mark datacenter as optional parameter
* Updated docs
* Updated tests

Fixes: #54986

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde
2019-05-22 11:40:09 +05:30
committed by GitHub
parent 4065692e13
commit 459776eb82
5 changed files with 82 additions and 21 deletions

View File

@@ -5,9 +5,8 @@
- import_role:
name: prepare_vmware_tests
# Testcase 0001: Add Distributed vSwitch
- &dvs_data
name: add distributed vSwitch
name: Add distributed vSwitch
vmware_dvswitch:
validate_certs: False
hostname: "{{ vcenter_hostname }}"
@@ -22,12 +21,31 @@
discovery_operation: both
register: dvs_result_0001
- name: ensure distributed vswitch is present
- name: Ensure distributed vswitch is present
assert:
that:
- dvs_result_0001.changed
# Testcase 0002: Add Distributed vSwitch again
- 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"
state: present
switch_name: dvswitch_0002
mtu: 9000
uplink_quantity: 2
discovery_proto: lldp
discovery_operation: both
register: dvs_result_0002
- name: Ensure distributed vswitch is present
assert:
that:
- dvs_result_0002.changed
# vcsim doesn't support ldp check (self.dvs.config.linkDiscoveryProtocolConfig.protocol)
- when: vcsim is not defined
block:
@@ -40,7 +58,6 @@
that:
- not dvs_result_0002.changed
# FIXME: Remove this testcase from block once vcsim supports distributed vswitch delete method
# Currently, vcsim does not support distributed vswitch delete option,
# Once this feature is available we can move this out of this block