openstack-ansible-os_nova/templates/nova-interfaces-template.j2
Adam Reznechek cbd64aa00a Add custom interfaces file and update docs for PowerVM RMC
This patch adds templating a custom Nova interfaces file for PowerVM only
to support doing mixed IPV4-only and IPV6-only deployments. It also adds
documentation for configuration of PowerVM RMC.

Change-Id: Ib1ff51c95998bbc3183ea9b896dc8fa2dfbc0435
Closes-Bug: #1643988
2016-11-29 18:11:42 +00:00

52 lines
1.3 KiB
Django/Jinja

# {{ ansible_managed }}
{% raw %}
# Injected by Nova on instance boot
#
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
{% for ifc in interfaces %}
auto {{ ifc.name }}
{% if ifc.address %}
iface {{ ifc.name }} inet static
hwaddress ether {{ ifc.hwaddress }}
address {{ ifc.address }}
netmask {{ ifc.netmask }}
broadcast {{ ifc.broadcast }}
{% if ifc.gateway %}
gateway {{ ifc.gateway }}
{% endif %}
{% if ifc.dns %}
dns-nameservers {{ ifc.dns }}
{% endif %}
{% endif %}
{% if use_ipv6 %}
{% if ifc.address_v6 %}
{% if libvirt_virt_type == 'lxc' %}
iface {{ ifc.name }} inet6 manual
post-up ip -6 addr add {{ ifc.address_v6 }}/{{ifc.netmask_v6 }} dev ${IFACE}
{% if ifc.gateway_v6 %}
post-up ip -6 route add default via {{ ifc.gateway_v6 }} dev ${IFACE}
{% endif %}
{% else %}
iface {{ ifc.name }} inet6 static
hwaddress ether {{ ifc.hwaddress }}
address {{ ifc.address_v6 }}
netmask {{ ifc.netmask_v6 }}
{% if ifc.gateway_v6 %}
gateway {{ ifc.gateway_v6 }}
{% endif %}
{% if ifc.dns_v6 %}
dns-nameservers {{ ifc.dns_v6 }}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% endraw %}