-
Notifications
You must be signed in to change notification settings - Fork 0
/
vw-imp.yml
43 lines (43 loc) · 1.37 KB
/
vw-imp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
- hosts:
- 1ivcs01test
# explicit gathering defined in local configuration, so no need for "gather_facts: false"
vars:
host: 1iesx01test.acme.com
tasks: # TBD: consider moving to import_playbook: '...-{{ intent }}.yml' loosing YAML ref/anchor subst.
- vmware_guest:
networks:
- &mg
name: VM Network MG
device_type: &dt
vmxnet3
mac: '{{ tst.ints.0.mac }}'
start_connected: yes
- &ec
name: VM Network MsEc
device_type: *dt
mac: '{{ tst.ints.1.mac }}'
start_connected: yes
- name: '{{ tnn }}|{{ ap }}|{{ epg }}' # e.g. TstDMZ1|MsEc|CAS
device_type: *dt
mac: '{{ tst.ints.2.mac }}'
allow_guest_control: yes
start_connected: yes
args: '{{ args }}'
register: reg
when: intent == 'present'
- vmware_guest: # remove ACI networks from the VM
networks:
- *mg
- *ec
- name: quarantine
device_type: *dt
mac: '{{ tst.ints.2.mac }}'
allow_guest_control: no
start_connected: no # nevertheless current state remain connected
state: present # absent to delete VM
args: '{{ args }}'
register: reg
when: intent == 'absent'
ignore_errors: true
#- debug: var=reg