Merge "Allows domain name to be configured"
[genesis.git] / foreman / ci / deploy.sh
index 4c0bf10..83d1b81 100755 (executable)
@@ -511,7 +511,8 @@ configure_network() {
     echo "${blue}Detecting network configuration...${reset}"
     ##detect host 1 or 3 interface configuration
     #output=`ip link show | grep -E "^[0-9]" | grep -Ev ": lo|tun|virbr|vboxnet" | awk '{print $2}' | sed 's/://'`
-    output=`/bin/ls -l /sys/class/net | tail -n +2 | grep -v virtual | cut -d " " -f10`
+    #output=`/bin/ls -l /sys/class/net | tail -n +2 | grep -v virtual | cut -d " " -f10`
+    output=`/bin/ls -l /sys/class/net | tail -n +2 | grep -v virtual | awk {'print $9'}`
   fi
 
   if [ ! "$output" ]; then
@@ -1106,8 +1107,12 @@ start_virtual_nodes() {
 
       ##modify provisioning to do puppet install, config, and foreman check-in
       ##substitute host_name and dns_server in the provisioning script
-      host_string=config_nodes_${node}_hostname
-      host_name=$(eval echo \$$host_string)
+      host_string=config_nodes_${node}_short_name
+      short_host_name=$(eval echo \$$host_string)
+      ##substitute domain_name
+      domain_name=$config_domain_name
+      sed -i 's/^domain_name=REPLACE/domain_name='$domain_name'/' vm_nodes_provision.sh
+      host_name=${short_host_name}.${domain_name}
       sed -i 's/^host_name=REPLACE/host_name='$host_name'/' vm_nodes_provision.sh
       ##dns server should be the foreman server
       sed -i 's/^dns_server=REPLACE/dns_server='${interface_ip_arr[0]}'/' vm_nodes_provision.sh