After examining the runcmd code (/usr/lib/python2.6/site-packages/cloudinit/config/cc_runcmd.py) I noticed that there is no “frequency” specified compared to others. Besides all the scripts do, it saves the scripts defined as shell scripts in / var / lib / cloud / instance / scripts / runcmd.
Therefore, if I specify the modules in detail, I MUST set the frequency.
cloud_config_modules: - mounts - locale - set-passwords - timezone - [ runcmd, always ] cloud_final_modules: - scripts-per-once - scripts-per-boot - scripts-per-instance - [ scripts-user, always ] - ssh-authkey-fingerprints
and scripts created by this particular one can be executed by "scripts-user", so I need to specify ie
- [ scripts-user, always ]
for runcmd scripts to work
Is this right to do? The documentation (at least 0.7.7 currently) lacks a proper explanation of runcmd and user scripts and their use
I also do not understand the difference between all modes, once (at the first start of the instance), instance (???), always (what I understand), ???? boot (the one that exists? Seems to work ...
EDIT:
ok, I found in cloudinit / settings.py:
# Valid frequencies of handlers/modules PER_INSTANCE = "once-per-instance" PER_ALWAYS = "always" PER_ONCE = "once"
and next to this, I found an explanation in this script:
[ root@euca-10-254-97-216 ~]
But I do not understand the difference between "once" and "instance". So, if the same image (rather a snapshot) with a new instance identifier doesn’t start in the case of “once”? in the case of "instance" will it be?