Improve vmware_dvswitch module (#48720)

This commit is contained in:
Christian Kotte 2018-11-30 09:34:43 +01:00 committed by ansibot
parent 93fd323457
commit 68cafbda2b
2 changed files with 642 additions and 148 deletions

View file

@ -78,27 +78,28 @@
# Testcase 0002: Add Distributed vSwitch again
- name: add distributed vSwitch again
vmware_dvswitch:
validate_certs: False
hostname: "{{ vcsim }}"
username: "{{ vcsim_instance['json']['username'] }}"
password: "{{ vcsim_instance['json']['password'] }}"
datacenter_name: "{{ item | basename }}"
state: present
switch_name: dvswitch_0001
mtu: 9000
uplink_quantity: 2
discovery_proto: lldp
discovery_operation: both
register: dvs_result_0002
with_items:
- "{{ datacenters['json'] }}"
- name: ensure distributed vswitch is present
assert:
that:
- "{{ dvs_result_0002.changed == false }}"
# vcsim doesn't support ldp check (self.dvs.config.linkDiscoveryProtocolConfig.protocol)
# - name: add distributed vSwitch again
# vmware_dvswitch:
# validate_certs: False
# hostname: "{{ vcsim }}"
# username: "{{ vcsim_instance['json']['username'] }}"
# password: "{{ vcsim_instance['json']['password'] }}"
# datacenter_name: "{{ item | basename }}"
# state: present
# switch_name: dvswitch_0001
# mtu: 9000
# uplink_quantity: 2
# discovery_proto: lldp
# discovery_operation: both
# register: dvs_result_0002
# with_items:
# - "{{ datacenters['json'] }}"
#
# - name: ensure distributed vswitch is present
# assert:
# that:
# - "{{ dvs_result_0002.changed == false }}"
# FIXME: Uncomment this testcase once vcsim supports distributed vswitch delete method