aboutsummaryrefslogtreecommitdiffstats
path: root/network/scripts
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2016-12-17 09:46:03 -0500
committerDan Prince <dprince@redhat.com>2016-12-17 09:46:03 -0500
commitc6f4d5bf908683600ed646be7ab5e1ab96d9b15b (patch)
tree8f4ac65b6b5f018a7913588207839f3b0125b949 /network/scripts
parent713a0326e4d0ffbd4531263b7bd638809c2a639c (diff)
net-conf: make bridge and interface name optional
Update the run-os-net-config.sh so that we make the bridge_name and interface_name parameters (supplied by the SoftwareConfig) optional. This allows operators to create custom network templates to be used on roles other than compute and controller which appear to be the only two roles which set bridge_name and interface_name parameters. Change-Id: I8997cf8177c1bf0e1f19de5f93dc4e81da1a951f
Diffstat (limited to 'network/scripts')
-rwxr-xr-xnetwork/scripts/run-os-net-config.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/network/scripts/run-os-net-config.sh b/network/scripts/run-os-net-config.sh
index fc1e6d54..5df67b78 100755
--- a/network/scripts/run-os-net-config.sh
+++ b/network/scripts/run-os-net-config.sh
@@ -1,7 +1,7 @@
#!/bin/bash
-# Note this script expects the following environment variables to be set
-# normally these are provided by the calling SoftwareConfig resource, but
-# they may also be set manually for testing
+# The following environment variables may be set to substitute in a
+# custom bridge or interface name. Normally these are provided by the calling
+# SoftwareConfig resource, but they may also be set manually for testing.
# $bridge_name : The bridge device name to apply
# $interface_name : The interface name to apply
#
@@ -113,8 +113,8 @@ if [ -n '$network_config' ]; then
mkdir -p /etc/os-net-config
# Note these variables come from the calling heat SoftwareConfig
echo '$network_config' > /etc/os-net-config/config.json
- sed -i "s/bridge_name/$bridge_name/" /etc/os-net-config/config.json
- sed -i "s/interface_name/$interface_name/" /etc/os-net-config/config.json
+ sed -i "s/bridge_name/${bridge_name:-''}/" /etc/os-net-config/config.json
+ sed -i "s/interface_name/${interface_name:-''}/" /etc/os-net-config/config.json
os-net-config -c /etc/os-net-config/config.json -v --detailed-exit-codes
RETVAL=$?