]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
exoscale: Run the cloud initialization process only once exoscale
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Aug 2025 09:51:18 +0000 (09:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 5 Aug 2025 09:51:18 +0000 (09:51 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/helper/exoscale-setup
src/initscripts/system/cloud-init

index a0475c2bb3ab9a2acb1c61035030b65797f71ed9..c8d5bd412279935683a0fd1824d8118354743051 100644 (file)
@@ -209,6 +209,11 @@ import_exoscale_configuration() {
                touch /var/ipfire/main/firstsetup_ok
        fi
 
+       # Run this all only once. The Exoscale metadata service does not
+       # give us a lot of information, so users are quite likely to make
+       # changes which should not be overwritten.
+       : > /var/ipfire/main/.cloud-init-done
+
        # All done
        echo_ok
 }
index 7721b5b8c7aae5326bf745fdf9bf1e05231d6de0..8b2ebbb5a9ecbe3ae35fe7b66d431d8c70693324 100644 (file)
 
 case "${1}" in
        start)
+               # Do nothing if this process has already been completed
+               if [ -e "/var/ipfire/main/.cloud-init-done" ]; then
+                       exit 0
+               fi
+
                # Check if we are running in the cloud
                if running_on_ec2; then
                        scriptname="/etc/rc.d/helper/aws-setup"