=== 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 | ||
cjdc_ | Hello all | 10:35 |
---|---|---|
cjdc_ | quick question: in cloud config's write_file userdata | 10:35 |
cjdc_ | how do i put a new line in the content? | 10:36 |
smoser | cjdc_, there are a lot of ways to do it. | 12:47 |
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:48 |
smoser | cjdc_, http://paste.ubuntu.com/7162529/ | 12:51 |
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:54 |
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:55 |
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:56 |
smoser | cjdc_, theres an example of dumping json. | 12:57 |
smoser | http://paste.ubuntu.com/7162563/ | 12:57 |
cjdc_ | smoser: I am trying that right now. thanks | 12:58 |
smoser | you can also base64 encode stuff. | 12:59 |
smoser | or use the '!!binary' | 12:59 |
smoser | sayalilunkad, "loads the contents of a file" ? | 13:02 |
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:04 |
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:05 |
sayalilunkad | smoser: Actually I am applying to an organization had given me this problem statement | 13:06 |
sayalilunkad | Write a Cloud-Init plug-in to load data from a file was the exact exercise to do | 13:07 |
smoser | well, if you just said that, i'd think that "config module" would probably be the right thing. | 13:08 |
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:09 |
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:13 |
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:14 |
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:15 |
sayalilunkad | smoser: okay | 13:16 |
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:17 |
smoser | thats expected, yes. look at the changes done in that diff, and make similar changes for what you want to accomplish. | 13:22 |
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:23 |
sayalilunkad | smoser: no problem! thanks a lot :) | 13:24 |
cjdc_ | smoser: it worked with dump! | 13:27 |
cjdc_ | thanks for the help | 13:27 |
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? | 16:21 |
=== harlowja_away is now known as harlowja | ||
=== alexpilotti_ is now known as alexpilotti | ||
smoser | mdorman, cloud-init doesnt start ssh | 18:06 |
smoser | on ubuntu ssh starts normally. | 18:06 |
smoser | your request makes sense though. | 18:06 |
smoser | to do it you'd have to modify the ssh job. | 18:07 |
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 | 18:08 |
=== harlowja is now known as harlowja_away | ||
=== harlowja_away is now known as harlowja | ||
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:40 |
smoser | right. it only restarts if it changes the config | 20:49 |
smoser | because it has to. | 20:49 |
mdorman | yeah. | 20:53 |
smoser | mdorman, is this ubuntu ? | 20:57 |
mdorman | nope, centos | 21:07 |
=== alexpilotti_ is now known as alexpilotti | ||
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:21 |
mdorman | yeah i was able to figure out a different solution | 23:24 |
smoser | what did you do ? | 23:24 |
mdorman | figured out that sysvinit wise, sshd was set to start after cloud-init | 23:26 |
mdorman | so it should have just worked | 23:26 |
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:27 |
mdorman | thanks for the help. gotta run | 23:31 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!