summaryrefslogtreecommitdiffstats
path: root/xci/playbooks/roles/create-nodes/templates
diff options
context:
space:
mode:
Diffstat (limited to 'xci/playbooks/roles/create-nodes/templates')
-rw-r--r--xci/playbooks/roles/create-nodes/templates/net-admin.xml.j214
-rw-r--r--xci/playbooks/roles/create-nodes/templates/net-mgmt.xml.j211
-rw-r--r--xci/playbooks/roles/create-nodes/templates/vm.xml.j213
3 files changed, 37 insertions, 1 deletions
diff --git a/xci/playbooks/roles/create-nodes/templates/net-admin.xml.j2 b/xci/playbooks/roles/create-nodes/templates/net-admin.xml.j2
new file mode 100644
index 00000000..aedbbeb7
--- /dev/null
+++ b/xci/playbooks/roles/create-nodes/templates/net-admin.xml.j2
@@ -0,0 +1,14 @@
+<network>
+ <name>{{ item }}</name>
+ <forward mode='nat'>
+ <nat>
+ <port start='1024' end='65535'/>
+ </nat>
+ </forward>
+ <bridge name='br-{{ item }}' stp='on' delay='0'/>
+ <ip address='{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].gateway }}' netmask='255.255.255.0'>
+ <dhcp>
+ <host mac="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}" ip="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.admin.interface].address }}"/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/xci/playbooks/roles/create-nodes/templates/net-mgmt.xml.j2 b/xci/playbooks/roles/create-nodes/templates/net-mgmt.xml.j2
new file mode 100644
index 00000000..4a9964c3
--- /dev/null
+++ b/xci/playbooks/roles/create-nodes/templates/net-mgmt.xml.j2
@@ -0,0 +1,11 @@
+<network>
+ <name>{{ item }}</name>
+ <forward mode='route'>
+ </forward>
+ <bridge name='br-{{ item }}' stp='on' delay='0'/>
+ <ip address='{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.mgmt.interface].gateway }}' netmask='255.255.255.0'>
+ <dhcp>
+ <host mac="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.mgmt.interface].mac_address }}" ip="{{ opnfv_vm_pdf.interfaces[opnfv_vm_idf.net_config.mgmt.interface].address }}"/>
+ </dhcp>
+ </ip>
+</network>
diff --git a/xci/playbooks/roles/create-nodes/templates/vm.xml.j2 b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2
index e4e41eda..6061fc52 100644
--- a/xci/playbooks/roles/create-nodes/templates/vm.xml.j2
+++ b/xci/playbooks/roles/create-nodes/templates/vm.xml.j2
@@ -36,10 +36,21 @@
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
- <source network='{{ vm_network }}'/>
+ <source network='{{ vm_network_admin }}'/>
<model type='{{ vm_nic }}'/>
+ {%- if vm_name == 'opnfv' -%}
<mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.admin.interface].mac_address }}'/>
+ {%- else -%}
+ <mac address='{{ item.1.interfaces[idf.net_config.admin.interface].mac_address }}'/>
+ {%- endif -%}
</interface>
+ {%- if baremetal | bool -%}
+ <interface type='network'>
+ <source network='{{ vm_network_mgmt }}'/>
+ <model type='{{ vm_nic }}'/>
+ <mac address='{{ item.1.interfaces[opnfv_vm_idf.net_config.mgmt.interface].mac_address }}'/>
+ </interface>
+ {%- endif -%}
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<video>