summaryrefslogtreecommitdiff
path: root/cloudinit/__init__.py
AgeCommit message (Collapse)Author
2011-02-07rename 'datadir' key to 'data' in pathmapScott Moser
2011-02-07call DataSource classes with sys_cfg argumentScott Moser
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-02-04fix logging in DataSource modulesScott Moser
Previous logging was getting 'None' set in the DataSource collections. Thus, 'log.debug' would throw error. I think it is proper to pull in the base cloudinit's log.
2011-02-01remove double slash returned by get_ipath_curScott Moser
2011-02-01fix the path for user scripts.Scott Moser
A bug caused user scripts to get stored in /var/lib/cloud/instance/scripts/<instance-id>/ which meant they would not get run by 'run-user-scripts'. LP: #711480
2011-01-31make write_to_cache raise errors if it fails rather than surpressingScott Moser
2011-01-31replace DataSource's self.logScott Moser
After adding the 'log' element to the DataSource class, pickling would fail with TypeError: can't pickle file objects Instead of having the object with a log reference, use one from 'DataSource.log' and have that set by cloudinit
2011-01-31close file descriptors given to cPickle.load and cPickle.dumpScott Moser
2011-01-28add previous-instance-id and previous-datasource files to cloud/dataScott Moser
add 'datasource' file to instance dir
2011-01-27fix the filename of the processed userdataScott Moser
Change /var/lib/cloud/instance/ user-data-raw.txt.i to user-data.txt.i
2011-01-27take correct action if def_log_file and syslog_fix_perms are emptyScott Moser
2011-01-27fix bug in fixing permission on default log fileScott 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 initial ovf data source classScott Moser
2011-01-25add support for redirecting output of cloud-init, cloud-config and cloud-finalScott Moser
2011-01-24move cloud-run-user-script.conf to cloud-final, use cloud-cfg for invokingScott Moser
This moves what was done as cloud-run-user-script.conf to 'cloud-final' and makes that re-use the cloud-init-cfg code, but simply with a different set of default configs. Also, adds keys_to_console and final_message cloud-config modules LP: #653271
2011-01-24cloudinit/__init__: fix get_cpath()Scott Moser
2011-01-24cloudinit/__init__.py: fixes to initfsScott 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-20support configuration of what is the default log fileScott Moser
since user names and group names wont' be the same on all images, allow configuration of what ownership to put on 'default_log_file'.
2011-01-19fix bug in get_cpathScott Moser
2011-01-19add 'data' entry in pathmap and move get_cpath to a static functionScott Moser
2011-01-19make scripts sub-dirs for per-<item>Scott Moser
2011-01-19convert 'cachedir' to 'seeddir', move cloud_config, scripts to instanceScott Moser
- cloud_config and scripts now live in instance directory - cachedir is now more correctly named 'seeddir'
2011-01-19move cache to instance specific dirScott Moser
2011-01-19move boothooks and user-data into instance dirScott Moser
2011-01-19initial /var/lib rework still lots to do. includes a fix for LP: #704509Scott Moser
LP: #704509
2011-01-19move user scripts ('#!' and runcmd) to be per-instance (LP: #675711)Scott Moser
Previously, if you ran an instance with either runcmd data or user-data scripts, it would run again after rebundle or create-image. This puts the files created by runcmd or user-data scripts into instance-id specific paths, and then runs them by that instance-id specific path. LP: #675711
2011-01-19add 'cloud-init-query' tool, to query fields from cloud dataScott Moser
At this point, this is appears much like a cripped 'ec2metdata' tool. However, it does provide a tool interface to some fields independent of their DataSource.
2011-01-18remove 'biultin' config, separate cloud.cfgScott Moser
This set of changes makes '/etc/cloud/cloud.cfg' support "#include" and "#opt_include". The idea is to then provide a base configuration and allow distro or local changes that would override that.
2010-09-10set grub-pc values based on user input or automaticallyScott Moser
LP: #623609
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-01fix removal of '#cloud-boothook' inside a boothookScott Moser
The goal was to remove '#cloud-boothook' from a part if the part started that way. This was to allow user data of #cloud-boothook #!/usr/bin/perl ... to be handled correctly. That had 2 bugs 1.) the prefix string was wrong 2.) was checking for '\r' in the wrong location
2010-06-18add cloud-config hooks for enabling byobu by default.Scott Moser
2010-06-18add ssh_import_id cloud-config moduleScott Moser
2010-06-18improve the cloud-init-run-module code a bit, fix LP:#568139Scott Moser
568139 was fixed because the test for "always" was using "is" instead of "==" LP: #568139
2010-06-18add the instance-id to the environment as INSTANCE_ID for boothooksScott Moser
passing the instance-id of this instance to a boothook will give it the unique id that is needed to implement run-once-per-instance.
2010-06-18add 'cloud-boothook' typeScott Moser
if user data is of type text/cloud-boothook, or begins with #cloud-boothook, then assume it to be code to be executed. Boothooks are a very simple format. Basically, its a one line header ('#cloud-config\n') and then executable payload. The executable payload is written to a file, then that file is executed at the time it is read. The file is left in /var/lib/cloud/data/boothooks There is no "first-time-only" protection. If running only once is desired, the boothook must handle that itself.
2010-06-17make cloud-config modules configurable by cloud-configScott Moser
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
2010-06-17remove use of cloudinit constants from util.py in get_base_cfg Scott Moser
use get_base_cfg from CloudInit:read_cfg
2010-06-17remove debug printfs from __init__Scott 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-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-24ensure that cache dir is present if not created, and tighten permissionsScott Moser
on object cache stored there.
2010-02-11rename EC2Init class to CloudInitScott Moser
2010-02-03globally remove ec2init and rename to cloudinitScott Moser