In Ubuntu images that do not have snapd debian package installed launching with the following user-data triggers cloud-init to run `snap refresh` when that command doesn't exist.
reproducer: lxc launch ubuntu-daily:jammy test-no-snap sleep 3 lxc exec test-no-snap -- cloud-init status --wait lxc exec test-no-snap -- apt remove snapd -y
cat > pkg-update.yaml <<EOF #cloud-config package_update: true EOF
lxc config set test-no-snap cloud-init.user-data="$(cat pkg-update.yaml)" lxc exec test-no-snap -- cloud-init clean --logs --reboot sleep 3
# expect no warnings/errors lxc exec test-no-snap -- cloud-init status --wait --format=yaml
# ensure no calls to snap refresh lxc exec test-no-snap -- egrep 'snap.*refresh' /var/log/cloud-init.log
In Ubuntu images that do not have snapd debian package installed launching with the following user-data triggers cloud-init to run `snap refresh` when that command doesn't exist.
reproducer:
lxc launch ubuntu-daily:jammy test-no-snap
sleep 3
lxc exec test-no-snap -- cloud-init status --wait
lxc exec test-no-snap -- apt remove snapd -y
cat > pkg-update.yaml <<EOF
#cloud-config
package_update: true
EOF
lxc config set test-no-snap cloud-init. user-data= "$(cat pkg-update.yaml)"
lxc exec test-no-snap -- cloud-init clean --logs --reboot
sleep 3
# expect no warnings/errors
lxc exec test-no-snap -- cloud-init status --wait --format=yaml
# ensure no calls to snap refresh cloud-init. log
lxc exec test-no-snap -- egrep 'snap.*refresh' /var/log/