Matt53 | anyone 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 |
---|---|---|
Matt53 | my write_files module looks like this | 00:33 |
Matt53 | ``` | 00:33 |
Matt53 | write_files: | 00:33 |
Matt53 | - content: "this is a test" | 00:33 |
Matt53 | path: /etc/chef/test1 | 00:33 |
Matt53 | ``` | 00:33 |
minimal | what's on line 147 of the user-data file? | 00:39 |
Matt53 | so using the data sources from TF to create the user-data file, and 147 has a commented line on it... | 00:41 |
Matt53 | unless it just can't have comments? | 00:42 |
minimal | communts are fine | 00:42 |
Matt53 | give me 3 min, just rebuilding now and have removed everything but the three write_file module lines | 00:44 |
minimal | check the user-data stored in /var/lib/cloud/instance/ | 00:44 |
Matt53 | okay just chucking those three lines in works | 00:51 |
minimal | yeah I suspect there error is elsewhere | 00:51 |
Matt53 | Do you know how to add multiple lines via the contents? just trying to pass some certs onto a machine | 00:52 |
Matt53 | appreciate the help ofc | 00:52 |
minimal | try again and have a look at the user-data stored in /var/lib/cloud/instance to try and find line 147 there | 00:52 |
minimal | yeah, it's documented in the examples: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#write-files | 00:53 |
minimal | perhaps you have a tab instead of spaces somewhere in the user data? | 00:53 |
Matt53 | yeah looking now at the user-data | 01:01 |
Matt53 | yeah figured it out | 01:03 |
minimal | there is also "cloud-init schema -c user-data.yaml" to validate a file | 01:03 |
Matt53 | i have a variable in my comment that apparently still resolves | 01:03 |
Matt53 | and its a pem key, so variable in the comment still resolves and the rest of the pem key is no longer commented | 01:04 |
Matt53 | silly but ty | 01:04 |
Matt53 | hadn't come across the /var/lib/cloud/instance directory before (been using cloud-init for like all of 4 days) so very helpful ty ty | 01:04 |
=== VoliKoN5 is now known as VoliKoN | ||
Matt53 | minimal 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 |
Matt53 | first line is like this vs last line | 01:41 |
Matt53 | ` -----BEGIN RSA PRIVATE KEY-----` | 01:41 |
Matt53 | `-----END RSA PRIVATE KEY-----` | 01:41 |
Matt53 | i guess could just replace all the newlines with \n\t but that seems iffy lol | 01:43 |
minimal | Matt53: on the same page, if you look at the CA Certificates section you'll see an example of a cert spaced equally | 01:50 |
minimal | so just added the same number of spaces in front of each line | 01: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 | ||
meena | falcojr: what's the difference between low and wishlist? | 16:39 |
falcojr | wishlist isn't actually a bug | 17:10 |
=== VoliKoN3 is now known as VoliKoN | ||
meena | falcojr: it's part of the refactoring effort, not sure what the best destination is for that | 19:19 |
=== VoliKoN7 is now known as VoliKoN | ||
=== janitha74 is now known as janitha7 | ||
falcojr | wishlist 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!