/srv/irclogs.ubuntu.com/2015/09/25/#cloud-init.txt

arkinIt isn't immediately clear from my google searches, but how do I add a public key to my "root" user08:05
arkinAny suggestions on the command failing—   - [mysql, -e, "GRANT ALL PRIVILEGES ON `{{ mysql_db }}`.`*` TO '{{ mysql_user }}'@'%'"]11:24
arkinI think its the * causing problems11:25
arkinI've tried escaping it with \* and the problem persists...11:25
crobertsrhI'm looking at adding swap to a vm (either fedora or ubuntu).  I'm currently trying to do it by using fallocate and mkswap in bootcmd, but that seems to be failing.  It leaves me with a 2GB disk (before launching, I used qemu-img resize to make a much larger disk) and no active swap (it did create a file, but it was much smaller than I tried in fallocate, probably because there wasn't enough disk).  Anyone have any tips?13:17
smosercrobertsrh, you could have cloud-init to it for you13:43
crobertsrhsmoser:  How would I do that?  (Sorry, slightly new to cloud-init)13:46
crobertsrhThe docs regarding this didn't make much sense to me.13:46
smosercrobertsrh, that is because it is not documented *at all*. :-(13:57
smoserhttp://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/revision/102213:57
smoserother than that commit.13:57
smosertheres an example config there.13:58
smoserif growpart is groing your disk, then when bootcmd runs, it wont have run yet.13:59
smoserso fallocate might correctly be telling you no (becase at that point there *is* not any space)13:59
smoserbut there might be .2 seconds later13:59
crobertsrhsmoser:  Thanks.  I think I got kicked toward the end of your messages.  I got things up to "but there might be .2 seconds later"14:02
crobertsrhWill the "swap:...." bit work with 0.7.5?  Or should I try to make images with a newer cloud-init version?14:05
smosercrobertsrh, probably not. :-(14:06
smoserit wont.14:07
crobertsrhThat's what I was gathering.  I did try that at one point...which lead me to believe that I was just unable to understand the documentation, but then I got looking into versions.  Thanks for your help.14:07
smoserok. so i think the reason it is not working for you is this:14:08
smoser * you use qemu-img to resize a disk from 2G to 10G14:08
smoser b.) you boot system.14:08
smoser c.) cloud-init runs your bootcommand with does 'fallocate 2G'.14:08
smoser   that fails, because there is no space14:08
smoser d.) cloud-init (.2 seconds later or thereabouts, in the 'resizefs' module) grows the partition and runs resize2fs14:09
smoser e.) crobertsrh goes in and says "why does the same thing i ran in 'c' work now, but it didnt then!"14:09
smosers/*/a./14:09
crobertsrhMakes sense.  I think my workaround will do me fine.  I'm doing fallocate, etc in runcmd, which seems to get me what I need for now.14:11
crobertsrhI realize it's not ideal, but I think it will be "good enough for now".  Thanks again for the help and explanation.14:11
smoserit should be good enough14:12
jtheuerCan I add a custom cloud-init module? (I want it to run after cc_ssh.py)17:11
smoseryou can. you have to add it to the list though17:12
jtheuerso I would have to add to /etc/cloud/cloud.cfg, correct?17:14
smoserright.17:14
smoserand add the 'cc_xxx.py' in the right place17:14
jtheueryeah, that would be my next question ;-)17:14
smoserdpkg-query --show cloud-init | grep cc_17:14
smoserput it in that directory. where you see the .py17:15
arkinsmoser: tried your recommendation [mysql, -e, "GRANT ALL PRIVILEGES ON `{{ mysql_db }}`.`*` TO '{{ mysql_user }}'@'%'"] but im still getting warnings about the * even when I put \* any recommendations?17:23
jtheuerbtw: I want to sign the generated ssh host keys (obviously between key generation and sshd start) -- ideas or hints are more than welcome!17:26
smoserarkin, i'm not sure what you mean. its possible you have other yaml rendering un-friendly characters there.17:29
smoserand *yaml* is screwing you before shell gets the chance (although you've saved yourself from shell by the array)17:29
smoseri'd yaml.load() your config and look at what the result is17:30
smoserto make sure the array looks like what you think it should17:30
arkinok cheers17:32
arkinwith the array do I need to esacpe * ?17:32
smatzekif the sql syntax and parsing becomes unbareable, could you try writing the command to a file using the write-files module where you could base64 encode the command / file contents, and then use runcmd to run "mysql < /tmp/commandfile" ?  Though who knows how yaml and the shell will work with that stdin redirect.17:41
=== ByPasS_ is now known as ByPasS
smoserarkin, you'll only have to escape if its a problem to yaml18:50
smoserarkin, run http://paste.ubuntu.com/12557719/18:51
smoserand see if the arry there is what you think you would want18:51
smoserif you your self correctly escaped all that on  shell command line.18:52
crobertsrhIs there a way I can re-run the cloud-init bits from the command line?  I've tried sudo /usr/bin/cloud-init -d modules, but I'm not seeing the things I did in write_files get re-done (they did get done at boot time, but the ownership of a file was not correct.  I'm trying to correct that).19:28
=== crobertsrh is now known as _crobertsrh
=== zz_gondoi is now known as gondoi
=== gondoi is now known as zz_gondoi

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