2016-08-06 02:12:55 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: find already defined local Vnets
|
|
|
|
virt_net: command=list_nets
|
|
|
|
delegate_to: 127.0.0.1 # local action
|
|
|
|
register: nets
|
|
|
|
|
2016-08-12 00:58:42 +02:00
|
|
|
#- debug: var=nets
|
2016-08-06 02:12:55 +02:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: construct Vnet xml file
|
|
|
|
template:
|
|
|
|
src: templates/loctenet.xml
|
|
|
|
dest: "{{ vm_path }}/loctenet.xml"
|
|
|
|
delegate_to: 127.0.0.1 # local action
|
|
|
|
|
|
|
|
- name: define Vnet
|
|
|
|
virt_net:
|
|
|
|
command: define
|
|
|
|
name: "ffmwu"
|
|
|
|
xml: "{{ lookup('file',vm_path ~ '/loctenet.xml') }}"
|
|
|
|
delegate_to: 127.0.0.1 # local action
|
|
|
|
|
|
|
|
when: not "ffmwu" in nets.list_nets
|
|
|
|
# block end
|
|
|
|
|
|
|
|
- name: exnsure activ Vnet ffmwu
|
|
|
|
virt_net: name=ffmwu state=active
|
|
|
|
delegate_to: 127.0.0.1 # local action
|