diff options
| author | Scott Moser <smoser@ubuntu.com> | 2010-06-17 22:22:39 -0400 |
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2010-06-17 22:22:39 -0400 |
| commit | 22184b7ca3f78808d8025bab5981ed92f8ad99f5 (patch) | |
| tree | 89c9f4b1991d5f453b7fec5d9239c09adeb7f0f3 /cloudinit/__init__.py | |
| parent | 257da18b16434360e656fe1ef94e4cf8ba3a5210 (diff) | |
| download | vyos-cloud-init-22184b7ca3f78808d8025bab5981ed92f8ad99f5.tar.gz vyos-cloud-init-22184b7ca3f78808d8025bab5981ed92f8ad99f5.zip | |
make cloud-config modules configurable by cloud-config
The list of cloud-config modules is now kept in cloud config itself.
There is a builtin list in cloudinit, which is overrideable by
/etc/cloud/cloud.cfg or user data cloud-config.
This should make the modules more easily added or removed (as no code
needs to be edited now)
Basic summary of changes:
- move CloudConfig.py -> cloudinit/CloudConfig/__init__.py
- split cloud-config modules into their own files named
cloudinit/CloudConfig/cc_<name>.py
- remove all the upstart/cloud-config-* scripts, replacing them with
upstart/cloud-config.conf
Diffstat (limited to 'cloudinit/__init__.py')
| -rw-r--r-- | cloudinit/__init__.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index d8f2c8c9..2b76a73f 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -26,6 +26,7 @@ userdata_raw = datadir + '/user-data.txt' userdata = datadir + '/user-data.txt.i' user_scripts_dir = datadir + "/scripts" cloud_config = datadir + '/cloud-config.txt' +#cloud_config = '/tmp/cloud-config.txt' data_source_cache = cachedir + '/obj.pkl' system_config = '/etc/cloud/cloud.cfg' cfg_env_name = "CLOUD_CFG" @@ -36,12 +37,13 @@ user: ubuntu disable_root: 1 cloud_config_modules: + - mounts + - ssh - apt-update-upgrade - - config-misc - - config-mounts - - config-puppet - - config-ssh + - puppet + - updates-check - disable-ec2-metadata + - runcmd log_cfg: built_in """ @@ -316,7 +318,9 @@ class CloudInit: # if 'clear_on_fail' is True and func throws an exception # then remove the lock (so it would run again) def sem_and_run(self,semname,freq,func,args=[],clear_on_fail=False): - if self.sem_has_run(semname,freq): return + if self.sem_has_run(semname,freq): + log.debug("%s already ran %s", semname, freq) + return try: if not self.sem_acquire(semname,freq): raise Exception("Failed to acquire lock on %s\n" % semname) |
