=== evilissimo is now known as Guest15530 === harlowja is now known as harlowja_away === harlowja_away is now known as harlowja === harlowja is now known as harlowja_away === Guest15530 is now known as evilissimo [10:35] Hello all [10:35] quick question: in cloud config's write_file userdata [10:36] how do i put a new line in the content? [12:47] cjdc_, there are a lot of ways to do it. [12:48] its yaml formated. [12:48] | should be enoughj right? [12:48] maybe the issues I am having is with escape characters [12:51] cjdc_, http://paste.ubuntu.com/7162529/ [12:54] oops. the thing at line 15 was wrong.... i actually hadn't updated /tmp/foo to what it shows. [12:54] http://paste.ubuntu.com/7162554/ [12:55] so in short, the guaranteed-works answer is to just use yaml.dump [12:55] you can also use json if you prefer [12:55] yaml is pure superset of json [12:56] Hello everyone, I am trying to write a cloud init pliugin to load the contents of a file. But I am not very familiar with the code base for cloud init. Could someone guide me a bit here [12:57] cjdc_, theres an example of dumping json. [12:57] http://paste.ubuntu.com/7162563/ [12:58] smoser: I am trying that right now. thanks [12:59] you can also base64 encode stuff. [12:59] or use the '!!binary' [13:02] sayalilunkad, "loads the contents of a file" ? [13:04] the two "plugin" ways to do something new in cloud-init are "config-modules" and "part-handler" [13:04] smoser: Yes, loading data from a file [13:05] additionally, if what you need to do is just run stuff on boot, you can lay down scripts in certain directories and they'll run. [13:05] thats less "plugin". [13:06] smoser: Actually I am applying to an organization had given me this problem statement [13:07] Write a Cloud-Init plug-in to load data from a file was the exact exercise to do [13:08] well, if you just said that, i'd think that "config module" would probably be the right thing. [13:09] those are in cloudinit/config/cc_* [13:09] and then you enable them by adding them to one of the module lists in config/cloud.cfg [13:09] ok so configuring a module can help with doing this? [13:13] smoser: Since I am fairly new to this can you give me some links that would help [13:13] Currently using this http://cloudinit.readthedocs.org/en/latest/topics/hacking.html [13:14] well, you can definitly run 'open(some_path_to_file).read()' from a config module, whic would qualify as "loading data from a file" in some sense. [13:14] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/790 [13:14] is an example of adding a config module. [13:15] Alright, thanks. Will try it [13:15] in that commit you can ignore the noise in util.py and cc_resizefs.py, as that was just moving a block of code from one place to a common place [13:16] smoser: okay [13:17] smoser: Also in my cloud-init/config I have only these two file cloud.cfg cloud.cfg.d [13:17] is that ok? [13:22] thats expected, yes. look at the changes done in that diff, and make similar changes for what you want to accomplish. [13:23] i'm sorry, but I really dont' have time to help you much more than that. [13:23] documentation improvements are welcome of course. [13:24] smoser: no problem! thanks a lot :) [13:27] smoser: it worked with dump! [13:27] thanks for the help [16:21] i'd like to have ssh not start until after clout-init has run (to install the ssh key), basically so that the user cannot even connect to ssh at all until the keys are installed. is there a way to tell cloud-init to start ssh after configuring the keys? === harlowja_away is now known as harlowja === alexpilotti_ is now known as alexpilotti [18:06] mdorman, cloud-init doesnt start ssh [18:06] on ubuntu ssh starts normally. [18:06] your request makes sense though. [18:07] to do it you'd have to modify the ssh job. [18:08] https://gist.github.com/pquerna/491a3487951131f35f8f <- example of an.. upcoming openstack ironic interfaces file that'll get dropped into configdrive (still needs some tweaks). ubuntu/deb should be fine, but will try to make the patches to get it working on rhel/etc in the next few weeks === harlowja is now known as harlowja_away === harlowja_away is now known as harlowja [20:40] smoser: yep, got it. makes sense. it does _restart_ ssh as part of the set-password module, but not totally what i want. i'll figure something out. [20:49] right. it only restarts if it changes the config [20:49] because it has to. [20:53] yeah. [20:57] mdorman, is this ubuntu ? [21:07] nope, centos === alexpilotti_ is now known as alexpilotti [23:21] mdorman, it migh tbe possible to run something as a boothook that stopped ssh from starting. [23:21] i tihnk that'd be possible on ubuntu. [23:21] but i dont know the centos jobs well enough [23:24] yeah i was able to figure out a different solution [23:24] what did you do ? [23:26] figured out that sysvinit wise, sshd was set to start after cloud-init [23:26] so it should have just worked [23:27] however, we use power broker to do auth on our linux machines to AD, and the bootstrap for that (which starts earlier) was actually starting ssh on its own [23:27] so just needed to turn that piece off, so that it started in the correct order according to stock init scripts [23:31] thanks for the help. gotta run