tripleo-quickstart-extras/roles/baremetal-prep-virthost/templates/add-provisioning-interface.sh.j2
Ronelle Landy 536df41285 Add user variables to the virthost connection
Without these variables, the user connecting to
the virthost will default to stack- which will
not work with zuul.

Change-Id: Ieffcccabcc92ae99cf9672c9acb8c83f6657812a
2019-03-04 08:24:12 -05:00

56 lines
1.3 KiB
Django/Jinja

#!/bin/bash
set -eux
### --start_docs
## Deploying a baremetal overcloud from a virtual machine undercloud
## =================================================================
## * The following set up steps are run *on the virthost machine* to allow the undercloud VM
## * to PXE boot the overcloud nodes:
## Set up the virthost machine for PXE forwarding
## ----------------------------------------------
## * Add a static IPADDR to the NIC on provisioning network
## ::
sudo cat > /etc/sysconfig/network-scripts/ifcfg-{{ virthost_provisioning_interface }} << EOF
NAME={{ virthost_provisioning_interface }}
IPADDR={{ virthost_provisioning_ip }}
NETMASK={{ virthost_provisioning_netmask }}
NM_CONTROLLED=no
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
ONBOOT=yes
HWADDR={{ virthost_provisioning_hwaddr }}
PEERDNS=yes
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
EOF
## * Bring the NIC down first
## ::
sudo ifdown {{ virthost_provisioning_interface }}
## * Bring the NIC up again
## ::
sudo ifup {{ virthost_provisioning_interface }}
## * Add the NIC on the provisioning interface to the "brovc" bridge
## ::
if ! sudo brctl show brovc | grep {{ virthost_provisioning_interface }}; then
sudo brctl addif brovc {{ virthost_provisioning_interface }}
fi
### --stop_docs