diff options
author | Martin Schwenke <martin@meltin.net> | 2013-03-12 15:22:23 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2013-03-12 15:57:47 +1100 |
commit | 78728fb1534842d127e9665f4dabee36f0ef215a (patch) | |
tree | 7624e5151bd489176d49630333024018feefd705 /config.d | |
parent | 0a6d897bdaf009f6e441dd8cb282624c3e05a975 (diff) | |
download | autocluster-78728fb1534842d127e9665f4dabee36f0ef215a.tar.gz autocluster-78728fb1534842d127e9665f4dabee36f0ef215a.tar.xz autocluster-78728fb1534842d127e9665f4dabee36f0ef215a.zip |
Fix NETWORKS configuration to support non-standard interface names
Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'config.d')
-rw-r--r-- | config.d/00base.defconf | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/config.d/00base.defconf b/config.d/00base.defconf index c7fe312..ddffc09 100644 --- a/config.d/00base.defconf +++ b/config.d/00base.defconf @@ -284,29 +284,16 @@ defconf NETWORK_TEMPLATE "|network_template" \ network_template () { - if [ -n "$CLUSTER" ] ; then - local md5=$(echo "$CLUSTER" | md5sum) - local nh=$(printf "%02x" $ip_offset) - local mac_prefix="02:${md5:0:2}:${md5:2:2}:00:${nh}:" - else - local mac_prefix="02:42:42:00:00:" - fi - - local n - local count=1 - for n in $NETWORKS ; do - local ch=$(printf "%02x" $count) - net="${n%/*}" - name="acnet_${net//./_}" + local netname dev ip mask mac opts + while read netname dev ip mask mac opts ; do cat <<EOF <interface type='network'> - <mac address='${mac_prefix}${ch}'/> + <mac address='${mac}'/> <model type='@@NICMODEL@@'/> - <source network='${name}'/> + <source network='${netname}'/> </interface> EOF - count=$(($count + 1)) - done + done <"$network_map" } |