When Juju provisions a machine, it writes out the groups for the ubuntu user, which overwrites any groups the ubuntu user had previously. For the case of xenial, this includes the lxd group.
Users entry in cloud config:
users:
- groups:
- adm
- audio
- cdrom
- dialout
- dip
- floppy
- netdev
- plugdev
- sudo
- video
lock_passwd: true
name: ubuntu
The groups are defined in cloudconfig/userdatacfg_unix.go:
// UbuntuGroups is the set of unix groups to add the "ubuntu" user to
// when initializing an Ubuntu system.
UbuntuGroups = []string{"adm", "audio", "cdrom", "dialout", "dip",
"floppy", "netdev", "plugdev", "sudo", "video"}
Do we need ro specialize this per OS since on Trusty the lxd group won't exist before LXD is installed (while on Xenial it is there by default). Is it possible to just not pass anything here and use the defaults?