summaryrefslogtreecommitdiff
path: root/cloud-init.py
AgeCommit message (Collapse)Author
2012-02-17cloud-init.py: exit success if no data sources foundScott Moser
previously, cloud-init would exit failure if no data sources were found. In the case of cloud-init-local, that was often the case. In the case of cloud-init (net) it is a bit more likely that the user would consider it failure if nothing was found. Potentially this could even be user-configurable.
2012-01-18Add HP to Copyright, and Juerg Haefliger Authors.Scott Moser
This copyright change reflects previous changes that Juerg made for pylint and pep8 cleanups. From: Juerg Haefliger <juerg.haefliger@hp.com> Date: Mon, 16 Jan 2012 10:45:12 +0100
2012-01-17[PATCH] PEP8 coding style fixes.Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> This pulls in the named patch for LP: #914739 with a few other changes.
2012-01-17[PATCH 3/4] Fix pylint conventions C0324 (comma not followed by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 2/4] Fix pylint conventions C0322 (operator not preceded by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 1/4] Fix pylint conventions C0321 (more than one statement on a ↵Scott Moser
single line) From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 01/13] Fix pylint warnings W0311 (bad indentation)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2011-12-19make stdin read from /dev/null for all cloud-init programs (LP: #903993)Scott Moser
the cloud-init programs are never intended to run interactively. Some programs were being run via subprocess, and would notice that their input was attached to a terminal (/dev/console). As a result, they they would try to prompt the user for input (apt-add-repository) This change simply re-opens standard input as /dev/null so any subprocesses will not end up blocking on input.
2011-08-22Add some network debug info printed to the consoleScott Moser
When 'cloud-init start' (network) runs, it will print information about the systems network info to the console. This will help in debugging instances. LP: #828186
2011-08-02This fixes LP: #819507, to make consume_userdata run 'always'Scott Moser
consume_userdata should really run always, rather than once per instance. The documentation says that boothooks were on their own for per-instance but since this routine was only being called once, they would only get called once. This modifies the behavior to be: user_script: per_always cloud_config : per_always upstart_job : per_instance cloud_boothook: per_always In order to not break part handlers that are existing, and expect to only be called once per instance, this adds a 'handler_version' item in a handler that can indicate the version (currently 1 or 2). If it is 2, then the hander will be passed the frequency (per-instance or per-always) that this is being run. That way the handler can differenciate between them. This also makes 'bootcmd' run every boot. That should be changable in cloud-config though, so users who dont like the behavior can modify it. LP: #819507
2011-06-17make the "cloud-config ready" command configurable (LP: #785551)Scott Moser
Previously, when cloud-config was ready, cloud-init would emit an upstart event with: initctl emit cloud-config Now, that command is configurable via the 'cc_ready_cmd' value in cloud.cfg or user data. The default behavior is not changed. LP: #785551
2011-03-02fix bug preventing early exit of cloud-init on 'no-net' pathScott Moser
2011-02-18improve startup if no eth0 is available (LP: #714807)Scott Moser
LP: #714807
2011-02-07add config option 'manual_cache_clean'.Scott Moser
This option allows user to specify manual cleaning of the /var/lib/cloud/instance/ link, for a data source that might not be present on every boot.
2011-01-26make cloud-init's warning more obviously a warning (prepend WARN)Scott Moser
2011-01-26rework of DataSource loading.Scott Moser
The DataSources that are loaded are now controlled entirely via configuration file of 'datasource_list', like: datasource_list: [ "NoCloud", "OVF", "Ec2" ] Each item in that list is a "DataSourceCollection". for each item in the list, cloudinit will attempt to load: cloudinit.DataSource<item> and, failing that, DataSource<item> The module is required to have a method named 'get_datasource_list' in it that takes a single list of "dependencies" and returns a list of python classes inside the collection that can run needing only those dependencies. The dependencies are defines in DataSource.py. Currently: DEP_FILESYSTEM = "FILESYSTEM" DEP_NETWORK = "NETWORK" When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM], then DataSourceOVF returns a single item list with a reference to the 'DataSourceOVF' class. When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM, DEP_NETWORK], it will return a single item list with a reference to 'DataSourceOVFNet'. cloudinit will then instanciate the class and call its 'get_data' method. if the get_data method returns 'True', then it selects this class as the selected Datasource.
2011-01-26change 'except' syntax to python 3 style.Scott Moser
Everywhere that there occurred: except Exception, e: changed to except Exception as e:
2011-01-25add support for redirecting output of cloud-init, cloud-config and cloud-finalScott Moser
2011-01-24cloud-init.py: fix bad variable nameScott Moser
2011-01-24cloud-init.py: add trailing carriage return to messageScott Moser
2011-01-21add function to cloud-init to run cloud-config style modulesScott Moser
add 'hostname' cloud-config option for setting hostname make rsyslog and resizefs run at cloud-init time
2011-01-19write the previous-hostname file to persistent cloud/dataScott Moser
This change just uses a different facility for coming up with the path. But, by design I'm chosing to put 'previous-hostname' in /var/lib/cloud/data/ rather than in /var/lib/cloud/instance/data/ The idea is that if the user: - started an instance - modified /etc/hostname - bundled instance (or create-image from it) - started new instance They would expect their modified /etc/hostname to persist. As such, the previous-hostname file should be cross-instance data. Bugs in this area include LP: #596993 and LP: #514492
2011-01-19improve log message on failure of initfs. run on both start-local and startScott Moser
2011-01-19cloud-init.py: log exception on failure to set hostnameScott Moser
2011-01-19initial /var/lib rework still lots to do. includes a fix for LP: #704509Scott Moser
LP: #704509
2011-01-18move setting of default locale out of cloud-init, into cloud-configScott Moser
Now, instead of setting a default value in cloud-init based only on the DataSource, this supports using 'locale' in the cloud-config.
2010-08-12initial dump of "sans-cloud" code (DataSourceNoCloud)Scott Moser
The new classes 'DataSourceNoCloud' and 'DataSourceNoCloudNet' implement a way to get data from the filesystem, or (very minimal) data from the kernel command line. This allows the user to seed data to these sources. There are now 2 "cloud-init" jobs, cloud-init-local that runs on mounted MOUNTPOINT=/ and 'cloud-init' that runs on start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0 and stopped cloud-init-local ) The idea is that cloud-init-local can actually function without network. The last thing in this commit is "uncloud-init". This tool can be invoked as 'init=/usr/lib/cloud-init/uncloud-init' It will "uncloudify" things in the image, generally making it easier to use for a simpler environment, and then it will exec /sbin/init.
2010-07-07manage hostname setting better (LP: #596993)Scott Moser
On EBS instances, a shutdown and later start would end up with a different IP address. In the case where the user has not modified /etc/hostname from its original value (seeded by metadata's 'local-hostname'), then cloud-init will again set the hostname and update /etc/hostname. In the case where the user *has* modified /etc/hostname, it will remain user managed. Additionally, if /etc/cloud/cloud.cfg contains 'preserve_hostname' value set to a True value, then /etc/hostname will not ever be touched. LP: #596993
2010-06-17cloud-init: remove additional new line in log messageScott Moser
2010-06-17add initial logging supportScott Moser
This logging infrastructure in cloudinit: - uses python logging - allows user supplied config of logging.config.fileConfig format to be supplied in /etc/cloud/cloud.cfg or in cloud_config by user data. - by default, tries to use syslog, if that is not available, writes directly to /var/log/cloud-init.log (syslog will not be available yet when cloud-init runs) - when using syslog, the doc/21-cloudinit.conf file provides a rsyslogd file to be placed in /etc/rsyslog.d/ that will file [CLOUDINIT] messages to /var/log/cloud-init.log
2010-06-15add vi modelines to python filesScott Moser
2010-05-05wait considerably longer (1050 seconds) for metadata service to come upScott Moser
Also - adds some debugging information when its waiting - add 'uptime' printout on initial cloud-init invocation
2010-03-02purge cache in cloud-init so it doesn't end up persisting across instancesScott Moser
The cache file location is not instance specific. As such, if it is not cleaned from the image, a re-bundle would get the old data. To avoid that, clear the cache in cloud-init.
2010-02-11rename EC2Init class to CloudInitScott Moser
2010-02-10only set hostname once per instance. (LP: #514492)Scott Moser
LP: #514492
2010-02-04add copyright informationScott Moser
2010-02-04more removal of 'ec2init' string, replacement with cloud-initScott Moser