Tags
automation, cloud-init, lxc, lxc profile, lxd, SSH, ssh-key, ubuntu, YAML
While provisioning LXD instance; we can define post deployment task using cloud-init. This will help us to import your public SSH keys, add new user, update packages and install new packages if required. To do that we use lxc profile.
First check what lxc profile you have. There should be one default profile.
# lxc profile list
Copy default profile and create new one
# lxc profile copy default production
Edit newly created profile
# lxc profile edit production
Use the following configuration. This is YAML file and for better formatting please download it from here
Continue reading