summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlberto Contreras <alberto.contreras@canonical.com>2023-04-03 13:32:45 +0200
committerAlberto Contreras <alberto.contreras@canonical.com>2023-04-14 11:44:03 +0200
commitbfb85c366acc12332d7881afbd5d4fdbcf65880e (patch)
tree80fda06b9ab889ab89a2f30b8b105a2b1a095a44
parent33049ff70f7029af25cea5a0f93e341abeefc88d (diff)
downloadcloud-init-git-bfb85c366acc12332d7881afbd5d4fdbcf65880e.tar.gz
d/cloud-init.preinst: clean up vestigial config
/etc/cloud/cloud.cfg.d/99-disable-network-activation.cfg on GCE instances after fix in upstream google-guest-agent.
-rw-r--r--debian/cloud-init.preinst9
1 files changed, 9 insertions, 0 deletions
diff --git a/debian/cloud-init.preinst b/debian/cloud-init.preinst
index 0dcef7c4..f7d11329 100644
--- a/debian/cloud-init.preinst
+++ b/debian/cloud-init.preinst
@@ -188,6 +188,14 @@ cleanup_oci_network_lp1956788() {
rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
}
+cleanup_gce_disable_network_activation_sc1440() {
+ # Remove vestigial /etc/cloud/cloud.cfg.d/99-disable-network-activation.cfg
+ # from GCE images now that google-guest-agent includes
+ # https://github.com/GoogleCloudPlatform/guest-agent/commit/8c36e064abebb814dc56647e8db43f261deb9a63
+ grep DataSourceGCE /var/lib/cloud/instance/datasource > /dev/null 2>&1 || return 0
+ rm -f /etc/cloud/cloud.cfg.d/99-disable-network-activation.cfg
+}
+
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "0.5.11-0ubuntu1"; then
@@ -232,6 +240,7 @@ case "$1" in
cleanup_lp1552999 "$oldver"
cleanup_oci_network_lp1956788
+ cleanup_gce_disable_network_activation_sc1440
esac