=== shardy_afk is now known as shardy | ||
kwadronaut | so, I read the docs: https://cloudinit.readthedocs.org/en/latest/topics/modules.html and think i still have some questions ;-) | 14:11 |
---|---|---|
smoser | kwadronaut, you can ask htem here. | 14:23 |
kwadronaut | smoser: cheers. First question is: how can I contribute to that specific page? | 14:24 |
smoser | its managed from code. | 14:24 |
smoser | so you can write doc and make bzr merge request. | 14:25 |
kwadronaut | oh bzr. i forgot that. | 14:26 |
kwadronaut | which module would (re)generate ssh server keys? | 14:26 |
kwadronaut | (I'm using the Debian packages) | 14:27 |
smoser | 'ssh' does that. | 14:31 |
smoser | cloudinit/config/cc_ssh.py | 14:31 |
kwadronaut | thanks | 14:32 |
kwadronaut | hmmm i am missing the right way to have it only run once (use case: take a snapshot, boot that, don't get a new ssh-key) | 14:58 |
smoser | kwadronaut, it should only run once. | 14:58 |
smoser | by default | 14:58 |
kwadronaut | in that case, i'll compare what i changed half a year ago with the defaults. | 14:59 |
smoser | so the way that is handled is that the default is 'PER_INSTANCE'. | 14:59 |
smoser | the module can define *its* defualt, by defining 'frequency' in it. (cc_ssh does not do that). the values expected are one of | 15:00 |
smoser | PER_INSTANCE = "once-per-instance" | 15:00 |
smoser | PER_ALWAYS = "always" | 15:00 |
smoser | PER_ONCE = "once" | 15:00 |
smoser | and cloud-config can define a overriding value. | 15:01 |
smoser | see example of 'cloud_config_modules' in doc/examples/cloud-config.txt | 15:01 |
kwadronaut | ah, but instances get a new instance-id here if you snapshot and fire up the snapshot | 15:02 |
kwadronaut | thanks, i'm reading | 15:03 |
kwadronaut | that document both has [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ] and [ apt-update-upgrade, always ] | 15:06 |
kwadronaut | i guess 1 way would be less confusing | 15:06 |
smoser | kwadronaut, well, cloud-init-per is just a generic command. | 16:15 |
smoser | that you can can put into /usr/local/bin/ scripts or whatever | 16:15 |
smoser | and it will run the command provided according to that frequency. | 16:16 |
smoser | it may not actually be necessary in that case any more. | 16:16 |
smoser | but at one point bootcmd's didn't work for frequency | 16:16 |
smoser | oh. yeah. you do need it there. | 16:17 |
smoser | because 'bootcmd' module does run 'per_always' | 16:17 |
smoser | but if you only want a command to run once or per-isntance, then that command has to control itself. | 16:18 |
smoser | kwadronaut, ^ did that make sense ? | 17:26 |
kwadronaut | i guess so, i was getting some food and will have a closer look today or tomorrow. | 18:42 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!