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

klwhat's the advantage of cloud-init over ansible?01:37
klor rather, where would you use one tool over the other01:37
larskskl: cloud-init runs when a system boots, *on that system*.  So, for example, if you need to install python first so that you could use ansible, cloud-init could take care of those package installations.  Or if you need to provision an ssh key before you are able to connect to the system, cloud-init can do that, too.01:40
smosercloud-init has the ability to run earlier in boot than ansible. but for the most part its job is to get you to some other management system.01:40
smoserOdd_Bloke, if you're bored and want some cloud-init work (or ayone for that matter)01:40
smoserhttps://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/142793901:40
kllarsks & smoser: thanks guys.01:41
smoserbut you probalby hav ecloud-init in there somewhere.01:41
smoserthats the idea. even if all it does is set up ssh host keys01:41
smoserand ssh public keys so ansible can take over.01:41
klThat makes perfect sense01:43
klCheers again :)01:43
=== harlowja_ is now known as harlowja_away
faizalHow to add a blank line. ..With write_files04:34
=== mgagne is now known as Guest75711
Odd_Blokesmoser: Those Python 2.6 failures boil down (I think) to this lovely behaviour change: http://paste.ubuntu.com/10526494/12:45
smoserOdd_Bloke, oh joy13:32
smoseri guess its easy enougnh to check python version and address.13:32
smoserif thats it.13:32
Odd_Blokesmoser: Yeah, I've hit this before actually.13:41
Odd_BlokeThe problem is that 2.6 uses cStringIO which doesn't handle Unicode.13:41
Odd_BlokeSo it's an easy enough fix.13:42
smoserOdd_Bloke, htanks13:42
Odd_Blokesmoser: Review of https://code.launchpad.net/~daniel-thewatkins/cloud-init/fix-dmi/+merge/251715 would be much appreciated; it's causing SmartOS to fail (and is probably (partially) behind the CloudSigma failures that bjf was seeing).13:43
smoserOdd_Bloke, thats very nice. thank you.13:47
Odd_Bloke:)13:47
smoserOdd_Bloke, the only ocmment i hvae on your code... i might be wront oo13:59
smoserer... 2 comments i guess.13:59
smosera.) i might make it check that /sys path exists on input _read_dmi_syspath14:00
smoserie, possibly the user doesnt know or care about the old dmidecode path.14:00
smosermaybe you have thoughts on that.14:00
smoserb.) LOG.debug("querying dmi data %s", dmi_key)14:00
smoser  is slightly faster (and consistent with outer cloud-init logging)14:01
smoser  than:14:01
smoser  LOG.debug("querying dmi data {0}".format(dmi_key))14:01
smoserin the case where LOG.debug is filtered out entirely, it will never do the string conversion14:01
smoserbut consistency is probably a more real argument ther.e14:01
Odd_Blokesmoser: I did initially have the code trying /sys/.../mapping[key] and then /sys/.../key, in case people didn't want to hand a dmidecode thing over.14:01
smoserneither of the above are strong feelings of mine.14:03
Odd_Blokesmoser: OTP for a bit, will pick it up in a bit.14:03
=== Guest75711 is now known as mgagne
=== mgagne is now known as Guest48046
=== Guest48046 is now known as mgagne_
=== mgagne_ is now known as Guest44965
=== Guest44965 is now known as mgagne
=== [1]claudiupopa is now known as claudiupopa
Odd_Blokesmoser: So the reason that I backed out the 'see if the given key exists in /sys/... before trying dmidecode' is that we will have some places that /sys/... doesn't exist.15:28
Odd_Blokesmoser: But most people will be developing on places where it does.15:28
Odd_Blokesmoser: So we will see things breaking unexpectedly.15:29
smoserOdd_Bloke, im' fine with that argument15:29
Odd_BlokeI'll make the logging changes in a minute.15:30
Odd_Blokesmoser: Logging changes pushed up to https://code.launchpad.net/~daniel-thewatkins/cloud-init/fix-dmi/+merge/25171516:09
smoserOdd_Bloke, i'll pull. thanks16:12
Odd_Blokesmoser: Thanks!16:13
=== [1]claudiupopa is now known as claudiupopa
Odd_Blokesmoser: https://code.launchpad.net/~daniel-thewatkins/cloud-init/fix-py26/+merge/251784 fixes tests on Python 2.6.17:24
Odd_Blokesmoser: Tests still pass on 2.7, but I can't check 3.4 because of a test hang.17:25
Odd_Blokesmoser: Which is fixed in https://code.launchpad.net/~daniel-thewatkins/cloud-init/fix-py34-test-hang/+merge/25172517:25
smoserOdd_Bloke, its probably udev related. 17:26
smoserthe test hang... udevadm gets run in the tests. it really shouldnt17:27
Odd_Blokesmoser: It is, in fact, HTTPretty related.17:27
smoseroh.17:27
Odd_BlokeThough I'm not ruling out the existence of more than one hang. ;)17:27
smoserhttp_proxy= ?17:27
smoserthe debian package unsets that explicilty17:27
Odd_Blokesmoser: Nope, something to do with it failing to monkey patch Python 3.4.2 correctly.17:27
Odd_BlokeOr, rather, failing to un-monkey-patch Python 3.4.2 correctly.17:28
Odd_Bloke(Because of a bug in Python 3.4.2)17:28
=== harlowja_away is now known as harlowja_
=== alexpilotti_ is now known as alexpilotti
=== [1]claudiupopa is now known as claudiupopa
stumpedQ: Using "write_files" to *append* to an existing file. I'm having troubles figuring out how to *append* to a file, no problems creating one. Can't seem to locate the method. Ideas?20:53
smoseri dont thhink you can append.20:54
smoseryeah, you cannot. it calls 20:55
smoser util.write_file(path, contents, mode=perms)20:55
smoserit'd have to pass 'omode=wb+'20:55
stumpedah, i see. Thanks. End of that research then. :P I'll move it to a runcmd20:56
stumpedIs there a special method of escaping the ">" characters? In a runcmd, I've tried adding the following text, but YAML appears to have problems with the ">"....20:58
stumped- "echo /tmp/afile.txt >> /tmp/anotherfile.txt"20:59
smoserhm..21:04
smoserinside the "" it doesnt like it?21:04
stumpeddoesn't seem to. I've tried a lot of different variants. My understanding is that a double-quote treats the entire string as literal.21:05
stumpedsorry, the word "echo" should be "cat".21:05
smoserhttp://paste.ubuntu.com/10531218/21:09
smoserseems to not need anything special to me21:09
smoserstumped, ^21:11
stumpedyes. I see. I'll play around with it more. Perhaps I made a mistake or it's something unique to the runcmd method of performing the systemcall to execute the string.21:12
stumpedsmoser: looks like my mistake. I believe I had a large "yum update" performing at the beginning of the runcmd list and it was still running when the system went into multiuser mode and I didn't realize it. I probably got myself confused by trying to escape >> with \>\> .. TL;dr; cascading set of errors made it look like it wasn't working.21:35

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