When I start a new Arch Linux container, I always do a couple of the same things no matter what:
Install sudo and create sudo group
Modify /etc/sudoers
Create a new user
Give the user a new password
etc.
Is there a way to automate this process via lxd? My first thought was to create a template image and use that, but the image would get stale pretty fast given Arch’s rolling releases. My other thought was to use file push to run a script in the new container, but that still requires at least some manual intervention (though admittedly not very much).
You can use the images:archlinux/cloud image which supports cloud-init.
Cloud-init can be used to do this kind of stuff and you can set your cloud-init config through user.user-data or user.vendor-data in LXD.
@stgraber Do you know where I can find documentation on the user and vendor data from cloud-init? I found their examples , but they don’t really say what each field in the yaml file does.
EDIT: nvm, It’s in the comments in the examples. Sorry about that.