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