prep-network: add support to IPv6 topology

Change-Id: I4c6ce5f9bb5760873c064bc570ed966d255413ff
This commit is contained in:
Gabriele Cerami 2016-11-22 17:00:27 +01:00
parent 1672d78db1
commit 823f587d37
2 changed files with 22 additions and 2 deletions

View File

@ -1,3 +1,4 @@
dependencies:
- libvirt
- tripleo
- extras-common

View File

@ -14,14 +14,13 @@ set -eux
source {{ working_dir }}/stackrc
{% if network_isolation == true and ipv6 == false %}
{% if network_isolation|bool %}
## Setup Networking
## ----------------
## * Enable NAT for "external" network.
## ::
RULE="-s {{undercloud_external_network_cidr}} ! -d {{undercloud_external_network_cidr}} -j MASQUERADE"
if ! sudo iptables -t nat -C BOOTSTACK_MASQ $RULE; then
@ -31,6 +30,7 @@ fi
{% for name, network in (undercloud_networks|default({})).items() if name == 'external' %}
{% if not overcloud_ipv6|bool %}
sudo bash -c 'cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-vlan{{ network.tag }}
DEVICE=vlan{{ network.tag }}
ONBOOT=yes
@ -44,7 +44,26 @@ OVS_OPTIONS={{ network.ovs_options }}
EOF'
sudo ifup ifcfg-vlan{{ network.tag }}
{% else %}
sudo bash -c 'cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-eth6
DEVICE=eth6
ONBOOT=yes
BOOTPROTO=static
IPADDR={{ network.address }}
NETMASK={{ network.netmask }}
IPV6ADDR={{ network.address6 }}
IPV6INIT=yes
EOF'
sudo ifup ifcfg-eth6
{%endif%}
{% endfor %}
{%endif%}
### --stop_docs