/srv/irclogs.ubuntu.com/2016/06/14/#cloud-init.txt

apssmoser: I just want to silent logs for apt tasks, like with the -q flag to normal apt-get commands08:38
apsI do want logs for other commands08:39
=== Toger_ is now known as Toger
harlowjaok eyes on https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-sysconfig/+merge/297115 would be nice :)18:01
harlowjamore data samples would be cool to18:02
satherI'm having trouble finding 'official' documentation on creating a module18:03
smoserharlowja, more examples of ?18:17
smoserOdd_Bloke, harlowja i have shame for both of you18:19
smosersather, what kind of module you want ? config ?18:19
smoserharlowja, http://paste.ubuntu.com/17334762/ <-- that is you18:20
smoserOdd_Bloke, http://paste.ubuntu.com/17334843/ <-- that is you18:22
sathersmoser: parsing user-data and writing it to a yaml file for another service to process later18:25
smosersather, check /var/lib/cloud/instance/user-data.txt18:26
smoserand /var/lib/cloud/instance/user-data.txt.i18:26
mgagneharlowja: what's the best way to download a diff of this merge request?19:03
smosermgagne, the 'Download diff' link at https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-sysconfig/+merge/297115 ?19:07
smosermaybe im' missing something19:07
mgagnesmoser: yea, I'm not geared to rebuild a new package against bzr19:07
mgagnesmoser: I can handle diff fine19:08
mgagneoh19:08
mgagnefound the link19:08
mgagnehttps://i265227674.restricted.launchpadlibrarian.net/265227674/b1aed10a-3259-11e6-8a1a-002481e91f22.txt?token=KWhCrx10JmGLMNdFlQVPDw4PBP3Cfm9119:08
mgagneok looks like I don't have the appropriate version to patch against. I used https://launchpad.net/~smoser/+archive/ubuntu/cloud-init-dev and it looks to be outdated compared to trunk.19:14
smoseryeah, mgagne i was just fixing that.19:15
smoserharlowja, if you run 'tox' do you get a file 'c' in top dir ?19:23
smosertests/unittests/test_cli.py that seems to create it19:29
harlowja_smoser hmmm19:57
harlowja_let's see19:58
smoserharlowja_, i fixed.19:58
harlowja_k19:58
harlowja_btw, data samples == openstack network_json samples19:59
harlowja_i have tests in https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-sysconfig/+merge/297115 that take that file, and test to see it gets rendered as expected19:59
harlowja_should also be able to easily do the same for eni rendering19:59
smosermgagne, the daily archive shoudl be up to date shortly20:04
smoserah. harlow right.20:05
rharpersmoser: did you share the cloudinit-data repo  ?20:06
rharperthat's got I think most of the example OS config data we've seen20:06
rharpercloudinit-ds-test20:07
harlowja_smoser lol, W503 line break before binary operator20:24
harlowja_oops20:24
harlowja_i have sinned20:24
harlowja_forgive me father20:24
harlowja_*for http://paste.ubuntu.com/17334762/20:24
smoserharlowja_, its ok. you were lucky in that Odd_Bloke did worse :).20:24
harlowja_lol20:24
smoserharlowja_, but for your penance...20:24
smoserwant to see if you can get rid of that 'c' file ?20:25
harlowja_i thought u said u did20:25
harlowja_?20:25
harlowja_why u not fix it yet20:25
harlowja_lol20:25
smoseri fixed your pep error20:26
harlowja_hmmm, good point20:26
harlowja_ok i fix 'c'20:26
smoserthefile that creates the 'c' is tests/unittests/test_cli.py20:26
harlowja_which line fixes it?20:27
harlowja_lol20:27
smoser:)20:28
harlowja_smoser what would u think about making bin/cloud-init -->> cloud-init/cmd/main.py and then using the python tooling to build this cmdline entrypoint21:03
smoseri do not believe i am opposed to such a thing21:03
harlowja_k21:04
harlowja_the whole test_cli gets less weird if thats done imho21:04
smoseryeah. i'm not sure why Odd_Bloke didn't suggest doing that.21:04
smoseri think maybe jsut when he did he wanted to be less invasive21:04
harlowja_ya, cause right now it does21:05
harlowja_' cli = imp.load_module(21:05
harlowja_            'cli', open(BIN_CLOUDINIT), '', ('', 'r', imp.PY_SOURCE))'21:05
harlowja_which is like woah21:05
harlowja_lol21:05
harlowja_because smoser  i did the following on that 'c' file21:11
harlowja_$ file c21:11
harlowja_c: python 2.7 byte-compiled21:11
harlowja_so i'm pretty sure its the imp module dynamically compiling that thing21:11
harlowja_and if then just bin/cloud-init is an actual importable thing, well this goes all away, ha21:11
harlowja_cause i'm pretty sure that c file is getting created way down in the import machinery21:16
smemshhello,  how do i affect changes to actual root user account (password, chpasswd, ssh_authorized_keys), not the "distro default" ? there does not seem to be a way to specify the user except if creating new one (comment says "add each entry to ~/.ssh/authorized_keys for the configured user or the first user defined in the user definition directive")21:20
smemshsame if i add password/chpasswd stanza it changes my "distro default" user, not root21:22
smemsh_does user-data override cloud.cfg in the image filesystem or which takes precendence?21:48
smemsh_mgagne: thanks for your gist, i don't think that sets the default user though, i think that would have to be done with redefined system_info or default_user21:49
mgagnelink I sent https://gist.github.com/mgagne/5a571499a337975b224e358b5286feb821:50
smemsh_mgagne: but, if that does change only the root user, that would solve my issue because i don't care about the "distro user"21:50
mgagnesmemsh_: this is the config we use in our images21:50
mgagneI can't find the ubuntu user in our image21:50
smemsh_mgagne: i didn't realize you could specify a user that already existed21:50
mgagnebut if it's built-in the base image, there is little you can do I guess21:51
mgagnewe build our own images from .iso so can't tell when config is applied against cloud images21:51
smemsh_mgagne: it looks like i can change the distro default user with system_info or default_user, but i don't know if my user-data will override the embedded cloud.cfg in the image or not, or if i would have to make my own images21:53
smemsh_mgagne: mgagne do you know if the filesystem-supplied cloud.cfg takes precedence over the same values provided from user-data? which "wins" if both places specify?21:54
mgagnelet me try against a cloud image, I think I have one somewhere21:54
mgagneI don,t know =)21:54
smemsh_mgagne: i will try, i thought might know21:55
mgagneonce stuff works, I often forget about the details =)21:55
mgagneworks for me21:56
harlowja_smoser  https://code.launchpad.net/~harlowja/cloud-init/cloud-init-fix-up-cli/+merge/297409 have fun21:58
harlowja_try that, no 'c' file should appear...21:58
smemsh_half the stuff in my vendor's cloud.cfg are using underscores and half are dashes.  they must both work22:01
smemsh_but then i see e.g. https://bugs.launchpad.net/cloud-init/+bug/1531582 which leads me to believe they have to be underscores22:02
harlowja_pretty sure we have some crappy logic to handle both22:02
smemsh_harlowja_: probably it would break a billion peoples' configs if you ever decided on one22:03
harlowja_ya22:03
smemsh_unfortunately it causes confusion and inconsistency, maybe flag day for version 3 or something ;-)22:04
harlowja_:-P22:04
smemsh_harlowja_: if i have same key supplied by both user-data and the cloud.cfg in the image which will have precedence?22:05
smemsh_and lists will not merge right?22:05
harlowja_http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/helpers.py#L259 the ordering22:05
* harlowja_ i forget if lists merge by default, probably not22:05
harlowja_so to my understanding smemsh_ user-data overrides all22:06
smemsh_ahh ok good, that makes more sense then22:06
harlowja_actually i take that back22:07
harlowja_its input config files (from say the cli)22:07
harlowja_then config files from the env (didn't know we could do that)22:07
harlowja_then user data -> then vendor data then datasource specific stuff then base22:08
smemsh_L260 comment22:08
harlowja_ya22:08
smemsh_you mean _read_cfg() ? ok22:08
smemsh_so datasource configs are user-data right?22:09
harlowja_nah, user data is @ http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/helpers.py#L23822:09
harlowja_datasource configs i'm not sure who uses those22:10
harlowja_i guess for datasources that don't have the concept of user-data?22:10
smemsh_so user-data are "instance configs" in that comment?22:11
smemsh_it says highest -> lowest are: input config files -> env config files -> override instance configs -> datasource configs -> base configuration22:13
harlowja_ya, that looks about right22:13
harlowja_and the default merge strategy doesn't overwrite keys from later entries over the newer ones22:14
harlowja_so a key 'x' in instance config will stay 'x' even if base configuration has the same key22:15
smemsh_so _get_instance_configs() is the one that picks up user-data ? i had thought that was a "datasource", hrm22:15
harlowja_its more complicated than that22:15
harlowja_the datasource does provide the user-data, but the consumption and merging and usage is a different stage of the app22:15
harlowja_there's a consumption stage and then there are merging/using that config stages22:16
harlowja_that ranking is post-consumption22:16
smemsh_by doing ConfigMerger once consumed22:16
harlowja_ya22:16
smemsh_from all sources22:16
harlowja_right22:16
smemsh_well i'll never say it's not configurable ;-)22:17
smemsh_as long as i know my user-data will override the cloud.cfg the vendor put there i'm good22:17
harlowja_:-p22:17
smemsh_thanks for explanation...22:18
harlowja_np22:18
smemsh_btw, there is a syntax for yaml to split long unbroken lines without any spaces, i noticed your docs have long lines for stuff like authorized_keys but they could split them (not sure if this is useful to change)22:23
harlowja_smemsh_ ya, there is, feel free to submit some adjustments if u want :)22:27
smemsh_i would if it were on github...22:28
smemsh_i guess i could set up a launchpad thingy and figure out bzr...22:28
* harlowja_ diverts question to smoser 22:28
harlowja_more people that yell at smoser about need-for-git the better :-P22:28
harlowja_where yell == encourage22:29
harlowja_lol22:29
smemsh_it's just too easy on github and part of normal workflow.  launchpad is some silo somewhere with different tools, not that it's bad or anything of course22:29
smemsh_i know canonical likes its umbrella projects on launchpad too if they fund it which is reasonable22:30
ajorgsmemsh_: well, it will let you override cloud.cfg, but only using the default merge strategy.22:57
smemsh_great i'm all working now.  thanks for help all, have good night.23:33
harlowja_smoser if u merge https://code.launchpad.net/~harlowja/cloud-init/cloud-init-fix-up-cli/+merge/297409 then merge https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-sysconfig also :-P23:45

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