Disable unattended upgrades before install pkgs

Related-Prod: PRODX-43174
Change-Id: I4dc611b95feef7d00d11d5c86bb9040590e12b6e
diff --git a/de/heat-templates/scripts/functions.sh b/de/heat-templates/scripts/functions.sh
index 2edb704..ae06d97 100644
--- a/de/heat-templates/scripts/functions.sh
+++ b/de/heat-templates/scripts/functions.sh
@@ -144,10 +144,13 @@
     systemctl restart atop
 }
 
-function install_required_packages {
+function disable_unattended_upgr {
     # Disable unattended upgrades
     sed -i 's/1/0/' /etc/apt/apt.conf.d/20auto-upgrades
     sed -i 's/APT::Periodic::Update-Package-Lists "1"/APT::Periodic::Update-Package-Lists "0"/g' /etc/apt/apt.conf.d/*
+}
+
+function install_required_packages {
     local pkg_list="apt-transport-https ca-certificates curl software-properties-common jq unzip atop iptables-persistent socat ntp rng-tools open-iscsi nfs-common"
 
     if [[ "${CONFIGURE_HUGE_PAGES}" == true ]]; then
diff --git a/de/heat-templates/scripts/launch.sh b/de/heat-templates/scripts/launch.sh
index 081e515..66d3a13 100644
--- a/de/heat-templates/scripts/launch.sh
+++ b/de/heat-templates/scripts/launch.sh
@@ -123,6 +123,7 @@
         # Please keep the "prepare_metadata_files", "disable-rp-filter", "network_config" and "prepare_network" functions
         # at the very beginning in the same order.
         ucp)
+            disable_unattended_upgr
             setup_bind_mounts
             wait_for_external_network
             prepare_metadata_files
@@ -164,6 +165,7 @@
             cron_disable_calico_offloading
             ;;
         master)
+            disable_unattended_upgr
             setup_bind_mounts
             wait_for_external_network
             nested_virt_config
@@ -197,6 +199,7 @@
             increase_iscsi_timeout
             ;;
         worker)
+            disable_unattended_upgr
             setup_bind_mounts
             wait_for_external_network
             if [[ "${CONFIGURE_HUGE_PAGES}" == true ]]; then
@@ -239,6 +242,7 @@
             increase_iscsi_timeout
             ;;
         frr)
+            disable_unattended_upgr
             wait_for_external_network
             prepare_metadata_files
             disable_rp_filter