[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH node] The node now passes in the mac address and iface names during identify.



This works with the patch for the server the generates a configuration file
for the node based on the interface names passed in with each mac address.

Additionally, the node will pull down the configuration and process it as a
script. Since the configuration will be composed of two separate parts:

1. a script to load one or more kernel modules
2. a configuration file to pass to augtool

The script is downloaded to a temp directory and then passed to bash. If
either of the two expected files is produced then it is further processed to
configure the node.

Signed-off-by: Darryl L. Pierce <dpierce redhat com>
---
 scripts/ovirt-early |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index 8024b3b..f890f9a 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -13,6 +13,11 @@
 # size of the oVirt partition in megabytes
 OVIRT_SIZE=64
 
+get_mac_addresses() {
+    macs=$(ifconfig | awk '/HWaddr/ { print $5"="$1 }' \
+                    | tr '\n' ' ' | sed 's/ /%2C/g;s/:/%3A/g')
+}
+
 configure_from_network() {
     DEVICE=$1
     if [ -n "$DEVICE" ]; then
@@ -31,12 +36,19 @@ configure_from_network() {
                 if [ -n "$SRV_HOST" -a -n "$SRV_PORT" ]; then
                     printf .
                     cfgdb=$(mktemp)
+                    get_mac_addresses
                     wget -q -O $cfgdb \
-                      "http://$SRV_HOST:$SRV_PORT/ovirt/cfgdb/$(hostname)"
+                      "http://$SRV_HOST:$SRV_PORT/ovirt/managed_node/config?host=$(hostname)&macs=$macs"
                     if [ $? -eq 0 ]; then
                         printf .
-                        echo "save" >> $cfgdb
-                        augtool < $cfgdb > /dev/null 2>&1
+                        bash $cfgdb
+                        if [ -f /var/tmp/pre-config-script ]; then
+                            printf "loading kernel modules"
+                            bash /var/tmp/pre-config-script
+                        fi
+                        if [ -f /var/tmp/node-augtool ]; then
+                            augtool < /var/tmp/node-augtool
+                        fi
                         if [ $? -eq 0 ]; then
                             printf "remote config applied."
                             return
-- 
1.5.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]