[04:45] anyone around? trying to merge to cloud-init files and not having any luck [04:46] the file /var/lib/cloud/instances/INSTANCE_ID/cloud.cfg only shows the first file, and i can see both files in user-data.txt === harlowja is now known as harlowja_away [05:36] n/m its working now [05:43] well, working more, its combining the two files, but its replacing sections, not combining [05:43] this doc http://cloudinit.readthedocs.org/en/latest/topics/merging.html seems to imply the new way should combine [05:44] and it gives an exact example of what i'm looking for -- combinging run_cmds [05:57] i tried the merge_how from comment #4 from https://bugs.launchpad.net/cloud-init/+bug/1316323 [05:57] but same thing [05:57] my run_cmd section is not merging [06:05] merge_how: "dict(allow_delete,recurse_array)+list(recurse_array,append)" [06:05] shouldn't that list(recurse_array,append) do the trick? [10:43] harlowja_away, I specified timezone as the following: [10:43] timezone: UTC [10:43] doesnt work [10:43] I specified timezone in /etc/cloud/cloud.cfg [10:43] but it was not set [12:50] so why that bloody cloud-init do not set timezone ?! [12:54] zilberstein: Is there anything in /var/log/cloud-init.log to suggest the problem? [12:57] Odd_Bloke, nothing related to timezone [12:57] that's the thing ! [12:57] it silently ignores timezone ! [12:58] zilberstein: How are you checking what timezone is set? (And what distro are you on?) [12:58] cat /etc/sysconfig/clock, redhat [12:58] 6 [12:58] also /etc/localtime [13:01] zilberstein: Is timezone in one of the module lists in cloud.cfg? [13:04] zilberstein, the timezone module only runs once per instance. [13:04] so booting, then changing /etc/cloud/cloud.cfg to have it, will not result in a reboot causing any change. [13:05] you'd need to specify user-data to affect it. or either [13:05] a.) rm /var/lib/cloud/instance/sem/config_timezone && reboot [13:06] b.) sudo cloud-init single --frequency=always --name=timezone [13:06] c.) give user-data (or a part of multipart user-data) including: [13:06] #cloud-config [13:06] timezone: UTC [13:07] d.) capture the image, and then deploy it again (which changes the instance-id, which makes that "per-instance" module run again). [13:08] also, as Odd_Bloke said, you have to make sure that the module is enabled in /etc/cloud/cloud.cfg [13:11] i'm not 100% certain that cloud-init timezone works for rhel, but what it looks like it intends to do is [13:11] delete /etc/localtime [13:12] symlink /etc/localtime -> /usr/share/zoneinfo/UTC [13:13] now, if /usr/share/zoneinfo/UTC did not exist, it log an exception 'Invalid timezone' [13:13] zilberstein, ^ [13:24] smoser, I know. Timezone was configured before instance started [13:25] zilberstein, cloud-init will configure it (i think correctly), but only does that once per instance. cloud-init is about initialization, not runtime sytem configuration. [13:25] smoser, I thought cloud-init should remove /etc/localtime and create new symlink on its own [13:25] well, it does. [13:25] once per instance. [13:26] launch an instance with the user-data (in 'c' above) and see if you get what you want. or do 'a'. i think it will. === harlowja_away is now known as harlowja [17:21] good morning friends [17:21] i'm having trouble merginging to cloud init configurations [17:22] i don't understand the merge syntax [17:22] its not combining my runcmd and write_files sections, but instead overriding them in the second file [17:34] smoser: whats that ubuntu version and branch for cirros-dev again? [17:37] https://code.launchpad.net/cirros [17:37] sry, u meant the updated buildroot for ubuntu 14.04 (?) :) [17:37] *I meant [17:38] ah [17:38] https://code.launchpad.net/~smoser/cirros/buildroot-upgrade [17:38] cool [17:39] smoser: any tips on how to debug merges? [17:41] nk121 eck, damn merging :( [17:41] :( [17:41] haha [17:41] i sorta created it, unleashed it on the world, lol [17:41] thanks :) [17:41] ^ for better or worse, ha [17:41] ha [17:42] i feel i'm trying to do something simple, just combine two files, no overwriting [17:42] actually q1- is there a way to re-run the merge without launching a new instance? (i figured out how to re-run cloud init on a box, but thats after the merge step) [17:43] q2- the docs seem to imply the defaults for the new merge style is what i'm looking for, but i don't see that being the case [17:43] hmmm, i don't think so; pretty sure the merging happens to early [17:43] let me see if i can make a way for u to try this merge stuff without having to boot instances all the time [17:44] if i don't have any merge_how sections, should the default do what i'm expecting? [17:44] which is, combine the two runcmd and write_files sections from two cloud init files [17:44] not overwrite or replace [17:45] (i'm running on trusty using the ec2 default image) [17:45] one way to find out :-P [17:45] well so far, does not seem to :P [17:47] :) [17:55] nk121 ok, so http://paste.ubuntu.com/10671425/ that should make it easier for u to mess around [17:55] if u just run that on a vm with cloud-init; u can adjust that and see what the final result is... [17:55] smoser: I noticed some nice fbsd specific additions on LP [17:56] harlowja: ok, i'll give it a shot [17:57] for example http://paste.ubuntu.com/10671436/ might be what u want [17:57] that comes up with [17:57] Merged result: [17:57] {'a': 'b', 'c': [1, 2, 3, 4]} [17:57] ^ list appends [17:57] if u feel like it, keep track of a little readme doc about this while u are learning, could be useful docs for others [17:58] since i know its not so obvious... [17:59] harlowja: sure, if i figure this out, i'll write up what i did and how to debug it [17:59] thx; feel free to mutate the above script; probably useful for others to [17:59] mutate/own/whatever lol [17:59] maybe mutate not best word :-P [18:00] i follow ya [18:06] wow, its so much faster to develop when you can re-run locally =-] [18:06] and your second paste lead me to the solution [18:06] i only had the merge_how section in the first file [18:07] that seems to not be whats described in Specifying multiple types and its effect in http://cloudinit.readthedocs.org/en/latest/topics/merging.html [18:09] or maybe i'm just not parsing that right [18:09] (the doc text) [18:12] ya, u probably don't need it in certain ones, but how it works is that the current payload defines the merge_how ; which will then be used with the prior already merged/whatever yaml [18:12] it doesn't really retain what was the 'last' [18:12] although it could i suppose, just doesn't currently [18:13] i think that doc page could use a working example, and an explanation of the merge options [18:13] sure [18:13] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/merging.rst [18:13] commits welcome ;) [18:13] or any adjustments u feel appropriate [18:14] ok i've added it to my list, i'll give it a shot after i get this milestone completed [18:14] cools [18:14] but regardless, you've got me unstuck, and i really appreciate that [18:15] np [18:15] here to serve! === harlowja is now known as harlowja_away === harlowja_away is now known as harlowja