5 # Configure cloud-init to allow image instanciation-time customization.
6 # The only cloud-init "datasources" that make sense for this image are:
8 # * "None": this is the last resort when nothing works. This prevents
9 # cloud-init from exiting with an error because it didn't find any datasource
10 # at all. This in turns allow to start the QEMU image with no
12 # * "NoCloud": this fetches the cloud-init data from a ISO disk mounted into
13 # the new VM or from other non-network resources. See
14 # https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
15 # for more information.
17 # Ultimately, this configures "datasource_list" in
18 # /etc/cloud/cloud.cfg.d/90_dpkg.cfg.
19 echo "cloud-init cloud-init/datasources multiselect NoCloud, None" \
20 | debconf-set-selections
22 # Configure localepurge to remove unused locales. This makes the image smaller.
23 echo "localepurge localepurge/use-dpkg-feature boolean true" \
24 | debconf-set-selections
25 echo "localepurge localepurge/nopurge multiselect en, en_US.UTF-8" \
26 | debconf-set-selections
28 # Reconfigure cloud-init
29 # Don't "lock" the "wpia" user password. It is configured directly by the
30 # preseeding and all the rest depends on it. Cloud-init, with the default
31 # configuration, overrides this user's settings and prevents from using it
32 # without a SSH key (which needs to be passed by the "cloud" user-data, which
33 # we may not always have.)
34 cat <<EOF > /etc/cloud/cloud.cfg.d/91-debian-user.cfg
35 # System and/or distro specific settings
36 # (not accessible to handlers/transforms)
38 # This will affect which distro class gets used
40 # Default user name + that default users groups (if added/used)
45 groups: [adm, audio, cdrom, dialout, dip, floppy, netdev, plugdev, sudo, video]
46 sudo: ["ALL=(ALL) NOPASSWD:ALL"]
48 # Other config here will be given to the distro class and/or path classes
50 cloud_dir: /var/lib/cloud/
51 templates_dir: /etc/cloud/templates/
52 upstart_dir: /etc/init/
56 primary: http://deb.debian.org/debian
57 security: http://security.debian.org/
61 # Don't let cloud-init to take over the network configuration.
62 # This prevents to have more fine-grained configuration and enable lot of
63 # automagic configuration on interfaces that could (should!) be managed outside
65 cat <<EOF > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg