[10:35] <cjdc_> Hello all
[10:35] <cjdc_> quick question: in cloud config's write_file userdata
[10:36] <cjdc_> how do i put a new line in the content?
[12:47] <smoser> cjdc_, there are a lot of ways to do it.
[12:48] <smoser> its yaml formated.
[12:48] <cjdc_> | should be enoughj right?
[12:48] <cjdc_> maybe the issues I am having is with escape characters
[12:51] <smoser> cjdc_, http://paste.ubuntu.com/7162529/
[12:54] <smoser> oops. the thing at line 15 was wrong.... i actually hadn't updated /tmp/foo to what it shows.
[12:54] <smoser> http://paste.ubuntu.com/7162554/
[12:55] <smoser> so in short, the guaranteed-works answer is to just use yaml.dump
[12:55] <smoser> you can also use json if you prefer
[12:55] <smoser> yaml is pure superset of json
[12:56] <sayalilunkad> 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] <smoser> cjdc_, theres an example of dumping json.
[12:57] <smoser> http://paste.ubuntu.com/7162563/
[12:58] <cjdc_> smoser: I am trying that right now. thanks
[12:59] <smoser> you can also base64 encode stuff.
[12:59] <smoser> or use the '!!binary'
[13:02] <smoser> sayalilunkad, "loads the contents of a file" ?
[13:04] <smoser> the two "plugin" ways to do something new in cloud-init are "config-modules" and "part-handler"
[13:04] <sayalilunkad> smoser: Yes, loading data from a file 
[13:05] <smoser> 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] <smoser> thats less "plugin".
[13:06] <sayalilunkad> smoser: Actually I am applying to an organization had given me this problem statement 
[13:07] <sayalilunkad> Write a Cloud-Init plug-in to load data from a file was the exact exercise to do
[13:08] <smoser> well, if you just said that, i'd think that "config module" would probably be the right thing.
[13:09] <smoser> those are in cloudinit/config/cc_*
[13:09] <smoser> and then you enable them by adding them to one of the module lists in config/cloud.cfg
[13:09] <sayalilunkad> ok so configuring a module can help with doing this?
[13:13] <sayalilunkad> smoser: Since I am fairly new to this can you give me some links that would help
[13:13] <sayalilunkad> Currently using this http://cloudinit.readthedocs.org/en/latest/topics/hacking.html
[13:14] <smoser> 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] <smoser> http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/790
[13:14] <smoser> is an example of adding a config module.
[13:15] <sayalilunkad> Alright, thanks. Will try it 
[13:15] <smoser> 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] <sayalilunkad> smoser: okay
[13:17] <sayalilunkad> smoser: Also in my cloud-init/config I have only these two file cloud.cfg  cloud.cfg.d
[13:17] <sayalilunkad> is that ok?
[13:22] <smoser> thats expected, yes. look at the changes done in that diff, and make similar changes for what you want to accomplish.
[13:23] <smoser> i'm sorry, but I really dont' have time to help you much more than that.
[13:23] <smoser> documentation improvements are welcome of course.
[13:24] <sayalilunkad> smoser: no problem! thanks a lot :)
[13:27] <cjdc_> smoser: it worked with dump!
[13:27] <cjdc_> thanks for the help
[16:21] <mdorman> 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?
[18:06] <smoser> mdorman, cloud-init doesnt start ssh
[18:06] <smoser> on ubuntu ssh starts normally.
[18:06] <smoser> your request makes sense though.
[18:07] <smoser> to do it you'd have to modify the ssh job.
[18:08] <pquerna> 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
[20:40] <mdorman> 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] <smoser> right. it only restarts if it changes the config
[20:49] <smoser> because it has to.
[20:53] <mdorman> yeah.
[20:57] <smoser> mdorman, is this ubuntu ?
[21:07] <mdorman> nope, centos
[23:21] <smoser> mdorman, it migh tbe possible to run something as a boothook that stopped ssh from starting.
[23:21] <smoser> i tihnk that'd be possible on ubuntu.
[23:21] <smoser> but i dont know the centos jobs well enough
[23:24] <mdorman> yeah i was able to figure out a different solution
[23:24] <smoser> what did you do ?
[23:26] <mdorman> figured out that sysvinit wise, sshd was set to start after cloud-init
[23:26] <mdorman> so it should have just worked
[23:27] <mdorman> 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] <mdorman> so just needed to turn that piece off, so that it started in the correct order according to stock init scripts
[23:31] <mdorman> thanks for the help.  gotta run