diff options
Diffstat (limited to 'ansible/roles/infra_create_network')
-rw-r--r-- | ansible/roles/infra_create_network/tasks/create_xml.yml (renamed from ansible/roles/infra_create_network/tasks/create_xml.yaml) | 53 | ||||
-rw-r--r-- | ansible/roles/infra_create_network/tasks/main.yml | 2 |
2 files changed, 20 insertions, 35 deletions
diff --git a/ansible/roles/infra_create_network/tasks/create_xml.yaml b/ansible/roles/infra_create_network/tasks/create_xml.yml index a01c7974a..345b77927 100644 --- a/ansible/roles/infra_create_network/tasks/create_xml.yaml +++ b/ansible/roles/infra_create_network/tasks/create_xml.yml @@ -40,48 +40,33 @@ xpath: /network add_children: - name: "{{ item.name }}" - - bridge - - ip + - forward: + mode: nat + - bridge: + name: "{{ item.name }}" + stp: "on" + delay: "0" + - ip: + address: "{{ item.host_ip }}" + netmask: "{{ item.netmask }}" pretty_print: yes -- name: Add "name" attribute to "bridge" node +- name: Add new children nodes to "forward" node xml: path: "{{ xml_file }}" - xpath: /network/bridge - attribute: name - value: "{{ item.name }}" - pretty_print: yes - -- name: Add "stp" attribute to "bridge" node - xml: - path: "{{ xml_file }}" - xpath: /network/bridge - attribute: stp - value: "on" - pretty_print: yes - -- name: Add "delay" attribute to "bridge" node - xml: - path: "{{ xml_file }}" - xpath: /network/bridge - attribute: delay - value: "0" - pretty_print: yes - -- name: Add "address" attribute to "ip" node - xml: - path: "{{ xml_file }}" - xpath: /network/ip - attribute: address - value: "{{ item.host_ip }}" + xpath: /network/forward + add_children: + - nat pretty_print: yes -- name: Add "netmask" attribute to "ip" node +- name: Add new children nodes to "nat" node xml: path: "{{ xml_file }}" - xpath: /network/ip - attribute: netmask - value: "{{ item.netmask }}" + xpath: /network/forward/nat + add_children: + - port: + start: "1024" + end: "65535" pretty_print: yes - name: Define the networks diff --git a/ansible/roles/infra_create_network/tasks/main.yml b/ansible/roles/infra_create_network/tasks/main.yml index eba4a3a49..025a775a1 100644 --- a/ansible/roles/infra_create_network/tasks/main.yml +++ b/ansible/roles/infra_create_network/tasks/main.yml @@ -18,5 +18,5 @@ name: infra_deploy_vars - name: Create XML file - include_tasks: create_xml.yaml + include_tasks: create_xml.yml with_items: "{{ infra_deploy_vars.networks }}" |