/srv/irclogs.ubuntu.com/2022/11/02/#cloud-init.txt

Matt53anyone able to help me with cloud-init write_files module? Keep running into `util.py[WARNING]: Failed loading yaml blob. Invalid format at line 147 column 1: "while scanning a simple key`00:32
Matt53my write_files module looks like this00:33
Matt53```00:33
Matt53write_files:00:33
Matt53  - content: "this is a test"00:33
Matt53    path: /etc/chef/test100:33
Matt53```00:33
minimalwhat's on line 147 of the user-data file?00:39
Matt53so using the data sources from TF to create the user-data file, and 147 has a commented line on it...00:41
Matt53unless it just can't have comments?00:42
minimalcommunts are fine00:42
Matt53give me 3 min, just rebuilding now and have removed everything but the three write_file module lines00:44
minimalcheck the user-data stored in /var/lib/cloud/instance/00:44
Matt53okay just chucking those three lines in works00:51
minimalyeah I suspect there error is elsewhere00:51
Matt53Do you know how to add multiple lines via the contents? just trying to pass some certs onto a machine00:52
Matt53appreciate the help ofc00:52
minimaltry again and have a look at the user-data stored in /var/lib/cloud/instance to try and find line 147 there00:52
minimalyeah, it's documented in the examples: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#write-files00:53
minimalperhaps you have a tab instead of spaces somewhere in the user data?00:53
Matt53yeah looking now at the user-data01:01
Matt53yeah figured it out01:03
minimalthere is also "cloud-init schema -c user-data.yaml" to validate a file01:03
Matt53i have a variable in my comment that apparently still resolves01:03
Matt53and its a pem key, so variable in the comment still resolves and the rest of the pem key is no longer commented01:04
Matt53silly but ty01:04
Matt53hadn't come across the /var/lib/cloud/instance directory before (been using cloud-init for like all of 4 days) so very helpful ty ty01:04
=== VoliKoN5 is now known as VoliKoN
Matt53minimal one more q for you if that's sweet? Trying to pass that same pem key as a var in the write_files module but it seems like the first line gets spaced properly, and the rest don't... Any way to pass a string with a newline in it and have it properly spaced?01:40
Matt53first line is like this vs last line01:41
Matt53`      -----BEGIN RSA PRIVATE KEY-----`01:41
Matt53`-----END RSA PRIVATE KEY-----`01:41
Matt53i guess could just replace all the newlines with \n\t but that seems iffy lol01:43
minimalMatt53: on the same page, if you look at the CA Certificates section you'll see an example of a cert spaced equally01:50
minimalso just added the same number of spaces in front of each line01:50
=== IchabodCrane is now known as DalekSec
=== VoliKoN8 is now known as VoliKoN
=== VoliKoN2 is now known as VoliKoN
=== VoliKoN5 is now known as VoliKoN
=== djhankb8 is now known as djhankb
=== VoliKoN9 is now known as VoliKoN
=== VoliKoN1 is now known as VoliKoN
=== jrm2 is now known as jrm
=== VoliKoN9 is now known as VoliKoN
=== VoliKoN2 is now known as VoliKoN
meenafalcojr: what's the difference between low and wishlist?16:39
falcojrwishlist isn't actually a bug17:10
=== VoliKoN3 is now known as VoliKoN
meenafalcojr: it's part of the refactoring effort, not sure what the best destination is for that19:19
=== VoliKoN7 is now known as VoliKoN
=== janitha74 is now known as janitha7
falcojrwishlist is good 22:00
=== VoliKoN0 is now known as VoliKoN

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