r1
This commit is contained in:
commit
b5d9cd03d8
34
tasks/main.yml
Normal file
34
tasks/main.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
- name: add vlans
|
||||||
|
local_action:
|
||||||
|
module: vmware_portgroup
|
||||||
|
hostname: "{{ vcenter_hostname }}"
|
||||||
|
username: "{{ vcenter_username }}"
|
||||||
|
password: "{{ vcenter_password }}"
|
||||||
|
validate_certs: false
|
||||||
|
hosts: "{{ item.0.hosts }}"
|
||||||
|
switch_name: "{{ item.0.switch_name }}"
|
||||||
|
vlan_id: "{{ item.1.id }}"
|
||||||
|
portgroup_name: "{{ item.1.name }}"
|
||||||
|
state: present
|
||||||
|
with_nested:
|
||||||
|
- "{{ vmw_hosts }}"
|
||||||
|
- "{{ vlan }}"
|
||||||
|
|
||||||
|
- name: delete vlans
|
||||||
|
local_action:
|
||||||
|
module: vmware_portgroup
|
||||||
|
hostname: "{{ vcenter_hostname }}"
|
||||||
|
username: "{{ vcenter_username }}"
|
||||||
|
password: "{{ vcenter_password }}"
|
||||||
|
validate_certs: false
|
||||||
|
hosts: "{{ item.0.hosts }}"
|
||||||
|
switch_name: "{{ item.0.switch_name }}"
|
||||||
|
portgroup_name: "{{ item.1.name }}"
|
||||||
|
state: absent
|
||||||
|
with_nested:
|
||||||
|
- "{{ vmw_hosts }}"
|
||||||
|
- "{{ delete_vlan }}"
|
||||||
|
when: "delete_vlan is defined and delete_vlan is iterable"
|
||||||
|
|
||||||
|
# vim: set tabstop=2 shiftwidth=2 expandtab smarttab:
|
||||||
Loading…
x
Reference in New Issue
Block a user