This message was deleted.
# general
s
This message was deleted.
i
Background: I'm trying to populate
cloud-init
data, and specifically to provide
pp_uuid
to encode machine UUID in the puppet certificate https://cloudinit.readthedocs.io/en/latest/topics/modules.html#puppet
g
If the UUID is assigned by the provider when the instance is created, it is not possible to use the value in an another property on the same resource.
I think openstack has a metadata service for instances to query data, so you could use that within your user-data script?
i
Hm, I'm trying to populate cloud-init, but maybe it has some support for querying metadata
Oh, nice, cloud-init apparently is able to get the data dynamically
👍 1
No, I didn't find a way to feed the machine uuid into the proper field for puppet...
g
Per https://docs.openstack.org/nova/latest/user/metadata.html#openstack-format-metadata, you can get the instance uuid from
<http://169.254.169.254/openstack/2018-08-27/meta_data.json>
. So
uuid=$(curl <http://169.254.169.254/openstack/2018-08-27/meta_data.json> | jq -r .uuid)
would provide a uuid you could use in a startup script.
i
Yeah, but the file I'd need to write to is again YAML, which means second line needs to get an indent, and from my experiments so far trying to encode in yaml a bash script writing out yaml ended up with
cloud-init
deciding it doesn't like that part of the configuration