Comment 0 for bug 2064132

Revision history for this message
Chad Smith (chad.smith) wrote : images without snapd installed error on `update_packages: true` user-data

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