1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/vmware_portgroup/tasks/main.yml
Abhijeet Kasurde 7a32bd8080
VMware: Improve vmware_portgroup (#56382)
* Rewrite vmware_portgroup module
* support check mode
* VLAN ID isn't required anymore
* VLAN ID 0 (no tagging) is the default
* Options match values in vSphere Client and vmware_vswitch module
* Policy override is configured properly
* VMware: vmware_portgroup updates
2019-05-14 14:34:43 +05:30

68 lines
1.8 KiB
YAML

# Test code for the vmware_portgroup module.
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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:
- debug: var=ccr1
- debug: var=host1
- name: Create portgroup without Portgroup and vSwitch
vmware_portgroup:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: no
ignore_errors: yes
register: no_pg_vs
- assert:
that:
- '"missing" in no_pg_vs.msg'
- name: Create portgroup without Portgroup
vmware_portgroup:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
vswitch: ''
validate_certs: no
ignore_errors: yes
register: no_vs
- assert:
that:
- '"missing" in no_vs.msg'
- name: Create portgroup without cluster
vmware_portgroup:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
vswitch: 'vSwitch_03'
portgroup: 'pg_03'
validate_certs: no
ignore_errors: yes
register: no_cluster
- assert:
that:
- '"cluster_name" in no_cluster.msg'
- name: Create portgroup
vmware_portgroup:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
vswitch: 'vSwitch_03'
portgroup: 'pg_03'
cluster_name: "{{ ccr1 }}"
validate_certs: no
state: present
ignore_errors: yes
register: pg_info
- assert:
that:
- pg_info.changed