/srv/irclogs.ubuntu.com/2021/07/05/#cloud-init.txt

=== andrewbogott is now known as Guest6437
=== Daniel is now known as toolz
Deckard111hi everyone11:51
Deckard111when I do : cloud-init query sys_info.uname11:51
Deckard111I get 11:52
Deckard111ti11:52
Deckard111[11:52
Deckard111 "Linux",11:52
Deckard111 "0.limesurvey.host",11:52
Deckard111 "5.4.0-77-generic",11:52
Deckard111 "#86-Ubuntu SMP Thu Jun 17 02:35:03 UTC 2021",11:52
Deckard111 "x86_64",11:52
Deckard111 "x86_64"11:52
Deckard111]11:52
Deckard111how would I access the 2nd string, only?11:52
Deckard111I need it in cloud-config11:52
falcojruname -n?12:31
Deckard111found a way to read it and output it using jinja12:41
Deckard111{{ sys_info.uname[1] }}12:41
Deckard111however this key seems to change value at some point so i get back a different value12:42
Deckard111so I am using {{ ds.meta_data.local_hostname }}12:42
Deckard111which works12:42
Deckard111falcojr uname-n would only work in the command section but I need to use it in the debconf module12:43
Deckard111there is stil something fishy though13:09
Deckard111I have another question:13:41
Deckard111A cloud init config may sometimes include sensitive information. What is the best way to wipe all config data, once cloud-init is finished?13:42
falcojrthe sensitive data gets stored in /run/cloud-init/instance-data-sensitive.json , but that file is only root readable and should get wiped on reboot13:45
falcojrand same with cloud-init query. If you're not running as root, it shouldn't return the sensitive data13:45
Deckard111hm.. I can find copies of it in /var/lib/cloud/instances/12954850/user-data.txt13:47
Deckard111is that provider-specific or also from cloud-init?13:49
falcojrthere's no supported way to remove that data13:50
Deckard111Could I just do it as a last command before reboot? Or would I saw off the branch I am sitting on? Let's try ;)14:05
Deckard111ok, I can definitely say that cloud-init does not like that ;)14:35

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!