From 124eaaf0153f6ef64626febfbd32cf882335d564 Mon Sep 17 00:00:00 2001
From: Doug Masiero <doug@masiero.tech>
Date: Mon, 16 Dec 2024 17:27:16 -0500
Subject: [PATCH] Update IP address set - cloud-init updates

---
 bolt_vm_automation/tasks/system_setup.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/bolt_vm_automation/tasks/system_setup.sh b/bolt_vm_automation/tasks/system_setup.sh
index 32baad3..9aced57 100644
--- a/bolt_vm_automation/tasks/system_setup.sh
+++ b/bolt_vm_automation/tasks/system_setup.sh
@@ -16,7 +16,7 @@ if [ -z "$IP" ] || [ -z "$HOSTNAME" ] || [ -z "$DHCP" ] || [ -z "$GATEWAY" ] ||
 fi
 
 # Create the new netplan configuration
-sudo tee /etc/netplan/50-cloud-init.yaml << EOL
+sudo tee /etc/cloud/cloud.cfg.d/90-installer-network.cfg << EOL
 network:
     version: 2
     ethernets:
@@ -26,7 +26,7 @@ EOL
 
 # If DHCP is false, add static IP configuration
 if [ "$DHCP" = "false" ]; then
-    sudo tee -a /etc/netplan/50-cloud-init.yaml << EOL
+    sudo tee -a /etc/cloud/cloud.cfg.d/90-installer-network.cfg << EOL
             addresses:
                 - ${IP}
             routes:
@@ -47,5 +47,8 @@ sudo sed -i "s/127.0.1.1.*/127.0.1.1\t${HOSTNAME}/" /etc/hosts
 echo "System configuration completed successfully"
 
 # Apply network configuration in the background and exit before it takes effect
-nohup bash -c "(sleep 2 && sudo netplan apply) &" > /dev/null 2>&1
+# nohup bash -c "(sleep 2 && sudo netplan apply) &" > /dev/null 2>&1
+# exit 0
+
+nohup bash -c "(sleep 2 && sudo reboot) &" > /dev/null 2>&1
 exit 0
\ No newline at end of file