Greetings all. I went to start tuning my LXD use by adding an SSH key to the ubuntu
user via a custom profile. I basically followed the steps from the docs to create a profile called default-cloudinit
like below:
config:
# this was what I started with, but eventually I found
# that it needed to be `user.user-data` to work...
cloud-init.user-data: |
#cloud-config
users:
- name: ubuntu
ssh_authorized_keys:
- ssh-ed25519 xxxxxxxxx
description: Default LXD profile with Cloud-init
devices:
eth0:
name: eth0
nictype: macvlan
parent: eth0
type: nic
root:
path: /
pool: default
type: disk
name: default-cloudinit
used_by: []
I then launched an instance with:
lxc launch ubuntu:20.04 test1 -p default-cloudinit
After much debugging (and deleting/recreating my container), I found that the cloud-init configuration in the profile would only be processed if I modified the config key from cloud-init.user-data
to user.user-data
. The docs seem to indicate using cloud-init.user-data
. Am I missing something here or are the docs misleading me?
Thanks!