Cannot set LXD REST API password

I’m trying to create an ansible playbook for provisioning my LXD hosts.

One of the steps is enabling remote access to the LXD API.

Unfortunately, whenever I try to set the password using lxc config set core.trust_password foo the password doesn’t get set, and lxc config get core.trust_password outputs true. Trying to set the password to the empty string ("") removes it from lxc config show, but trying to set it again has the same effect. Setting core.https_address works fine, it’s just the password that’s acting up.

Output of lxc config show --verbose:

config:
  core.https_address: 0.0.0.0:8443
  core.trust_password: true

I’m using LXD 3.4 from the snap package on Ubuntu 18.04. I experience this issue both on a baremetal server and a vagrant VM.

The ansible role in question is here.

Not sure if this is a bug in my playbook or in LXD. Perhaps setting up the initial configuration via a template messes it up somehow?

And the password isn’t working?

LXD will not show you the value of the password because it’s immediately hashed and so there’s no plain text version of it left, which is why we just show it as the boolean “true” rather than the string you set it to.

Well, I’m an idiot. The password does indeed work! Sorry for wasting your time with such a newbie mistake.