Profiles edit via yaml in snap package not working?

Maybe I missed something, but when I try to edit a profile via a yaml file like the lxc profile edit command mentions:

Examples
cat profile.yaml | lxc profile edit
Update a profile using the content of profile.yaml

It doesn’t seem to work when using the snap LXD package (2.20).

I did the following:
sjoerd@asterix:~$ lxc profile create test
Profile test created

My profile.yaml contains:
sjoerd@asterix:~$ cat profile.yaml
#cloud-config
packages:

  • openssh-server
  • pwgen

Then I do as the example says:
sjoerd@asterix:~$ cat profile.yaml | lxc profile edit test
sjoerd@asterix:~$ lxc profile show test
config: {}
description: “”
devices: {}
name: test
used_by: []

So still empty?

sjoerd@asterix:~$ which lxc
/snap/bin/lxc
sjoerd@asterix:~$ snap list
Name Version Rev Developer Notes
core 16-2.29.4.2 3604 canonical core
lxd 2.20 5235 canonical -

I think it is a wording issue. The command
cat myprofile.yaml | lxc profile edit myprofile
is going to set the myprofile profile to what is inside the file myprofile.yaml.

That is, since your myprofile.yaml is empty of commands, it will clear up the myprofile profile.
You need a few more lines to specify the cloud-init data.

Hmm I see your point…I guess I misinterpreted the cloud-init concept, although I would ave sworn it worked before like this since I had put it in my own wiki.
Thanks for the feedback and I’ll dive into the cloud-init procedures to see how I should accomplish it.