summaryrefslogtreecommitdiffstats
path: root/autocluster
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-06-16 16:05:41 +1000
committerMartin Schwenke <martin@meltin.net>2014-06-25 20:46:15 +1000
commit14bdb63258802ac3dd4556aaae1c9e65064b5075 (patch)
treeb7abb1458b387d51f5e9553f321a0a9bd43979ba /autocluster
parent32c1902eb8094ab5ebc75b1e32cef6fe50ee483b (diff)
downloadautocluster-14bdb63258802ac3dd4556aaae1c9e65064b5075.tar.gz
autocluster-14bdb63258802ac3dd4556aaae1c9e65064b5075.tar.xz
autocluster-14bdb63258802ac3dd4556aaae1c9e65064b5075.zip
Generate 70-persistent-net.rules when configuring node network
Force this to avoid any potential generation of "well known" names. Simplify the ifcfg-* generation code here, since template subsitution is not necessary. Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'autocluster')
-rwxr-xr-xautocluster13
1 files changed, 10 insertions, 3 deletions
diff --git a/autocluster b/autocluster
index 54e7462..75b9951 100755
--- a/autocluster
+++ b/autocluster
@@ -778,8 +778,7 @@ setup_network()
while read netname dev ip mask mac opts; do
echo " $dev"
cat <<EOF | \
- diskimage substitute_vars \
- - "/etc/sysconfig/network-scripts/ifcfg-${dev}"
+ diskimage put - "/etc/sysconfig/network-scripts/ifcfg-${dev}"
DEVICE=$dev
ONBOOT=yes
TYPE=Ethernet
@@ -787,7 +786,15 @@ IPADDR=$ip
NETMASK=$mask
HWADDR=$mac
EOF
- done <"$network_map"
+
+ # This goes to 70-persistent-net.rules
+ cat <<EOF
+# Generated by autocluster
+SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="${mac}", ATTR{type}=="1", KERNEL=="eth*", NAME="${dev}"
+
+EOF
+ done <"$network_map" |
+ diskimage put - "/etc/udev/rules.d/70-persistent-net.rules"
}
register_hook setup_base_hooks setup_network