/srv/irclogs.ubuntu.com/2015/03/24/#cloud-init.txt

nk121anyone around? trying to merge to cloud-init files and not having any luck04:45
nk121the file /var/lib/cloud/instances/INSTANCE_ID/cloud.cfg  only shows the first file, and i can see both files in user-data.txt04:46
=== harlowja is now known as harlowja_away
nk121n/m its working now05:36
nk121well, working more, its combining the two files, but its replacing sections, not combining05:43
nk121this doc http://cloudinit.readthedocs.org/en/latest/topics/merging.html  seems to imply the new way should combine 05:43
nk121and it gives an exact example of what i'm looking for -- combinging run_cmds05:44
nk121i tried the merge_how from comment #4 from https://bugs.launchpad.net/cloud-init/+bug/131632305:57
nk121but same thing05:57
nk121my run_cmd section is not merging05:57
nk121merge_how: "dict(allow_delete,recurse_array)+list(recurse_array,append)"06:05
nk121shouldn't that list(recurse_array,append) do the trick?06:05
zilbersteinharlowja_away, I specified timezone as the following:10:43
zilbersteintimezone: UTC10:43
zilbersteindoesnt work10:43
zilbersteinI specified timezone in /etc/cloud/cloud.cfg10:43
zilbersteinbut it was not set10:43
zilbersteinso why that bloody cloud-init do not set timezone ?!12:50
Odd_Blokezilberstein: Is there anything in /var/log/cloud-init.log to suggest the problem?12:54
zilbersteinOdd_Bloke, nothing related to timezone12:57
zilbersteinthat's the thing !12:57
zilbersteinit silently ignores timezone !12:57
Odd_Blokezilberstein: How are you checking what timezone is set? (And what distro are you on?)12:58
zilbersteincat /etc/sysconfig/clock, redhat12:58
zilberstein612:58
zilbersteinalso /etc/localtime 12:58
Odd_Blokezilberstein: Is timezone in one of the module lists in cloud.cfg?13:01
smoserzilberstein, the timezone module only runs once per instance.13:04
smoserso booting, then changing /etc/cloud/cloud.cfg to have it, will not result in a reboot causing any change.13:04
smoseryou'd need to specify user-data to affect it. or either13:05
smoser a.) rm /var/lib/cloud/instance/sem/config_timezone && reboot13:05
smoserb.) sudo cloud-init single --frequency=always --name=timezone13:06
smoserc.) give user-data (or a part of multipart user-data) including:13:06
smoser #cloud-config13:06
smoser timezone: UTC13:06
smoserd.) capture the image, and then deploy it again (which changes the instance-id, which makes that "per-instance" module run again).13:07
smoseralso, as Odd_Bloke said, you have to make sure that the module is enabled in /etc/cloud/cloud.cfg13:08
smoseri'm not 100% certain that cloud-init timezone works for rhel, but what it looks like it intends to do is13:11
smoser delete /etc/localtime13:11
smoser symlink /etc/localtime -> /usr/share/zoneinfo/UTC13:12
smosernow, if /usr/share/zoneinfo/UTC did not exist, it log an exception 'Invalid timezone'13:13
smoserzilberstein, ^13:13
zilbersteinsmoser, I know. Timezone was configured before instance started13:24
smoserzilberstein, 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
zilbersteinsmoser, I thought cloud-init should remove /etc/localtime and create new symlink on its own13:25
smoserwell, it does.13:25
smoseronce per instance.13:25
smoserlaunch an instance with the user-data (in 'c' above) and see if you get what you want. or do 'a'. i think it will.13:26
=== harlowja_away is now known as harlowja
nk121good morning friends17:21
nk121i'm having trouble merginging to cloud init configurations17:21
nk121i don't understand the merge syntax17:22
nk121its not combining my runcmd and write_files sections, but instead overriding them in the second file17:22
harmwsmoser: whats that ubuntu version and branch for cirros-dev again?17:34
smoserhttps://code.launchpad.net/cirros17:37
harmwsry, u meant the updated buildroot for ubuntu 14.04 (?) :)17:37
harmw*I meant17:37
smoserah17:38
smoserhttps://code.launchpad.net/~smoser/cirros/buildroot-upgrade17:38
harmwcool17:38
nk121smoser: any tips on how to debug merges?17:39
harlowjank121 eck, damn merging :(17:41
nk121:(17:41
harlowjahaha17:41
harlowjai sorta created it, unleashed it on the world, lol17:41
nk121thanks :)17:41
harlowja^ for better or worse, ha17:41
harlowjaha17:41
nk121i feel i'm trying to do something simple, just combine two files, no overwriting17:42
nk121actually 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:42
nk121q2- 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 case17:43
harlowjahmmm, i don't think so; pretty sure the merging happens to early17:43
harlowjalet me see if i can make a way for u to try this merge stuff without having to boot instances all the time17:43
nk121if i don't have any merge_how sections, should the default do what i'm expecting?17:44
nk121which is, combine the two runcmd and write_files sections from two cloud init files17:44
nk121not overwrite or replace 17:44
nk121(i'm running on trusty using the ec2 default image)17:45
harlowjaone way to find out :-P17:45
nk121well so far, does not seem to :P17:45
harlowja:)17:47
harlowjank121 ok, so http://paste.ubuntu.com/10671425/ that should make it easier for u to mess around17:55
harlowjaif u just run that on a vm with cloud-init; u can adjust that and see what the final result is...17:55
harmwsmoser: I noticed some nice fbsd specific additions on LP17:55
nk121harlowja: ok, i'll give it a shot17:56
harlowjafor example http://paste.ubuntu.com/10671436/ might be what u want17:57
harlowjathat comes up with17:57
harlowjaMerged result:17:57
harlowja{'a': 'b', 'c': [1, 2, 3, 4]}17:57
harlowja^ list appends17:57
harlowjaif u feel like it, keep track of a little readme doc about this while u are learning, could be useful docs for others17:57
harlowjasince i know its not so obvious...17:58
nk121harlowja: sure, if i figure this out, i'll write up what i did and how to debug it17:59
harlowjathx; feel free to mutate the above script; probably useful for others to17:59
harlowjamutate/own/whatever lol17:59
harlowjamaybe mutate not best word :-P17:59
nk121i follow ya18:00
nk121wow, its so much faster to develop when you can re-run locally =-]18:06
nk121and your second paste lead me to the solution18:06
nk121i only had the merge_how section in the first file18:06
nk121that seems to not be whats described in Specifying multiple types and its effect  in http://cloudinit.readthedocs.org/en/latest/topics/merging.html18:07
nk121or maybe i'm just not parsing that right18:09
nk121(the doc text)18:09
harlowjaya, 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 yaml18:12
harlowjait doesn't really retain what was the 'last'18:12
harlowjaalthough it could i suppose, just doesn't currently18:12
nk121i think that doc page could use a working example, and an explanation of the merge options18:13
harlowjasure18:13
harlowjahttp://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/merging.rst18:13
harlowjacommits welcome ;)18:13
harlowjaor any adjustments u feel appropriate18:13
nk121ok i've added it to my list, i'll give it a shot after i get this milestone completed18:14
harlowjacools18:14
nk121but regardless, you've got me unstuck, and i really appreciate that18:14
harlowjanp18:15
harlowjahere to serve!18:15
=== harlowja is now known as harlowja_away
=== harlowja_away is now known as harlowja

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