summaryrefslogtreecommitdiff
path: root/cloudinit
AgeCommit message (Collapse)Author
2012-08-28distros/ubuntu.py: remove unused import (pylint)Scott Moser
2012-08-27clean up a bit, fix issue with missing 'log' argument to ssh_import_idsScott Moser
2012-08-27Fixed critical bug where user and group creation was being done after SSHBen Howard
configurations were applied. The result of this bug was that cloud-config supplied SSH public keys would fail to apply since the configured user may or may not exist. (LP: #1042459). cloudinit/config/cc_ssh_import_id.py: ssh_import_id.py now handles all user SSH import IDs. cloudinit/distros/ubuntu.py: Removed create_user class override as cruft, since ssh_import_id now handles all users. config/cloud.cfg: Moved users_groups to run under cloud_init_modules. doc/examples/cloud-config.txt: Added missing documentation on user and group creation.
2012-08-27DataSourceEc2: require 'instance-data' as top level domainScott Moser
In searching for the metadata service, require 'instance-data' to be at the top level domain. Previously any misconfigured 'search' in /etc/resolv.conf could result in unintended use of a metadata server. LP: #1040200
2012-08-24use openstack metadata version 2012-08-10 unless not availableScott Moser
If 'latest' is found, but '2012-08-10' is not, we will log a warning but attempt to use it.
2012-08-24use instance-id, not previous-instance-id.Scott Moser
at the point where we are getting the previous instance id, there cloud-init hasn't performed the move yet. Therefore, the "previous" is the one that /var/lib/cloud/data/ says is the current.
2012-08-24use 'uuid' as 'instance-id'Scott Moser
openstack metadata uses 'uuid' as an instances 'instance-id'. just copy that to the metadata['instance-id']
2012-08-24committing in preparation for actual testScott Moser
2012-08-23some more tests.Scott Moser
2012-08-23fix pep8 and pylintScott Moser
2012-08-23initial functional unit testScott Moser
2012-08-22cc_ssh.py: add the "get user zero" logic, disable root even if no userScott Moser
cc_ssh.py was getting user of None, which ended up with a root user not getting ssh keys updated. That was bad. So, I duplicated the "get user zero" code that appeared other places here. Then, we disable the root user even if there is not a user. In that case we just use the string "NONE" in the disable message.
2012-08-22do not attempt the useradd command if user existsScott Moser
Previously we were only logging that the user existed and then still trying to run the command (which would raise error) As a result, none of the rest of the things would be done (sshimport id and such)
2012-08-22pep8 fixesScott Moser
2012-08-22fix duplicate flags being passed to useraddScott Moser
Fix bug here: adduser_cmd = ['useradd', name] x_adduser_cmd = adduser_cmd is different than x_adduser_cmd = ['useradd', name] The problem was they referenced the same list, and we were doubly appending.
2012-08-22remove now pointless __init__ in ubuntuScott Moser
2012-08-22distros: add_default_user is no longer abstractScott Moser
2012-08-22fix issues from 'make pylint'Scott Moser
In an effort to pylint errors about NonImlementedError and add_default_user, I moved this method to distro and genericized it. Now, assuming a sane 'create_user' for the distro, this should work. Also: * removed the unused set_configured_user method
2012-08-22fix errors from 'make pep8'Scott Moser
2012-08-22Merge with lp:cloud-initBen Howard
2012-08-22Simplified users[0] detection, and ensured compatability with previous user ↵Ben Howard
password control code
2012-08-22Fix the userdata population in DataSourceNoneScott Moser
Fix the userdata being populated to a dict (incorrect) and let it instead be populated by the userdata processor with the raw userdata (either empty or datasource config provided).
2012-08-22add apt_reboot_if_required to reboot if requiredScott Moser
If an upgrade or package installation forced a reboot (such as a kernel upgrade), then we can optionally reboot at that point. This allows the user to not be into the newest available kernel without needing a reboot on their own. LP: #1038108
2012-08-22improve the check for "uses unknown key" in mirror templatesScott Moser
instead of substituting and then checking for presense of a unlikely to occur string, this only adds to the search list if there is no KeyError raised.
2012-08-22fix for pep8 issues and seemingly functional now.Scott Moser
2012-08-22merge from trunk for pep8 fixesScott Moser
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-08-22Fix the userdata being populated to a dict (incorrect)Joshua Harlow
and let it instead be populated by the userdata processor with the raw userdata (either empty or datasource config provided).
2012-08-22return results from datasource.get_package_mirror_infoScott Moser
2012-08-22rework package mirror selectionScott Moser
There are several changes here. * Datasource now has a 'availability_zone' getter. * get_package_mirror_info * Datasource convenience 'get_package_mirror_info' that calls the configured distro, and passes it the availability-zone * distro has a get_package_mirror_info method * get_package_mirror_info returns a dict that of name:mirror this is to facilitate use of 'security' and 'primary' archive. * this supports searching based on templates. Any template that references undefined values is skipped. These templates can contain 'availability_zone' (LP: #1037727) * distro's mirrors can be arch specific (LP: #1028501) * rename_apt_lists supports the "mirror_info" rather than single mirror * generate_sources_list supports mirror_info, and as a result, the ubuntu mirrors reference '$security' rather than security (LP: #1006963) * remove the DataSourceEc2 specific mirror selection, but instead rely on the above filtering, and the fact that 'ec2_region' is only defined if the availability_zone looks like a ec2 az.
2012-08-22fix pylint in cc_ssh_authkey_fingerprints.pyScott Moser
2012-08-21remove committed conflicts in previous mergeScott Moser
2012-08-21Implemented MP feedback.Ben Howard
2012-08-20remove duplicate printing of authorized keys to the consoleScott Moser
see LP: #1039303 for more information. Hopefully we'll get a good fix there.
2012-08-20authkey_fingerprints: Fix columns headers, do not print empty linesScott Moser
This fixes the column headers and and adds a check to make sure that a key given is one that we actually want to print out. Also add in a config option which lets people select a different hashing method (not md5 if they want).
2012-08-20Add the "None" datasourceScott Moser
The None datasource is the last resort fallback datasource. It is identifiable by a property 'is_disconnected' that indicates that the datasource used is "not connected to a datasource". This will allow any thing that needs to run to still run in the absense of a DataSource. Also, we add a logging of the datasource found in final_message, and a warning if the None datasource is found. LP: #906669
2012-08-20Dropped hidden command; replaced with logstring. Also changed useradd ↵Ben Howard
command to use log options over short
2012-08-20Added "userless" mode to cloud-init for handling the creation of theBen Howard
users and the default user on Ubuntu. cloudinit/config/cc_users_groups.py: new cloud-config module for creating users and groups on instance initialization. - Creates users and group - Sets "user" directive used in ssh_import_id cloudinit/config/cc_ssh_import_id.py: module will rely upon users_groups for setting the default user. Removed assumption of 'ubuntu' user. cloudinit/distros/__init__.py: Added new abstract methods for getting and creating the default user. cloudinit/distros/ubuntu.py: Defined abstract methods for getting and and creating the default 'ubuntu' user on Ubuntu instances. cloudinit/util.py: Added ability to hide command run through util.subp to prevent the commands from showing in the logs. Used by user_groups cloud-config module. config/cloud.cfg: Removed "user: ubuntu" directive and replaced with new user-less syntax. doc/examples/cloud-config.txt: Documented the creation of users and groups.
2012-08-20add ssh-authkey-fingerprint config module, to print fingerprints to consoleScott Moser
Example output: ci-info: +---------+-------------------------+---------+-----------------+ ci-info: | Keytype | Fingerprint (md5) | Options | Comment | ci-info: +---------+-------------------------+---------+-----------------+ ci-info: | ssh-rsa | e3:..:84:81:72:38:..:6a | - | smoser@brickies | ci-info: | ssh-rsa | 21:..:32:8a:da:98:..:42 | - | smoser@bart | ci-info: | ssh-rsa | 7b:..:ac:a7:17:51:..:b2 | - | smoser@kaypeah | ci-info: +---------+-------------------------+---------+-----------------+
2012-08-20Remove the matching of the filesystem dep andJoshua Harlow
add in the ability to use any fallback userdata or metadata found in the datasource config (if provided).
2012-08-20Fixup the columns and add a check to makeJoshua Harlow
sure that a key given is one that we actually want to print out. Also add in a config option which lets people select a different hashing method (not md5 if they want).
2012-08-19Add a 'none' datasource as a last resort fallbackJoshua Harlow
1. This will allow a basically empty datasource to be activated (as the last datasource) when no other datasources work. This allows modules to still run (if they can, new function added to the datasource if modules want to check if cloud-init is in this 'disconnected' state).
2012-08-18Add support for printing out the authkey's for the default user.Joshua Harlow
1. Adjust the sshutil so that it has functions for doing this (used by the previous functions) 2. Create a new module that pretty prints out the given authorized keys fetched (if any) using the standard md5 scheme (for now), this module can be disabled by setting 'no_ssh_fingerprints' or just removing it from the running list.
2012-08-14Add RHEVm and vSphere support as datasource AltCloudScott Moser
These changes add a new data source to cloud-init to support passing user data to RHEVm and vSphere. The user data is passed to RHEVm v3.0 (current version) using a floppy injection hook and to vSphere via cdrom device. RHEVm v3.1 will use a method similar to vSphere. Once available support for that is also expected.
2012-08-10Address review feedback for:Joe VLcek
https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542/comments/255564 https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542/comments/255565
2012-08-10Adjustments so that the default old event is used whenJoshua Harlow
no args are provided. Adjust the config file to use this older method so that older changes aren't needed. Also when calling 'initctl' emit fails log the exception message so that some useful warning information can be produced.
2012-08-09Move the code that did the 'cloud-config' upstart event name emitting to Joshua Harlow
a config module and make it more generic in that it can take in a list of event names to emit as arguments. Add a yaml example to replace the functionality removed from the main binary.
2012-08-08Address review feedback for:Joe VLcek
https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542
2012-08-06add protection against dns-redirection to is_resolvableScott Moser
In an effort to make the EC2 Datasource's search under ec2.archive.ubuntu.com resilient against dns redirection, we add some code to is_resolvable. One future enhancement for this would be to protect against server side round robin results. Ie, if 'bogus-entry' returned 10.0.1.1 one time, and then 10.0.1.2 a second time. We could check if results where within the same 3 octets, and assume invalid if they were.
2012-08-06re-add the 'main' routine to DataSourceMAAS.pyScott Moser
the main function, which was usable for debugging maas was dropped during the rework branch. I'm adding it back here as it is very useful. It is possibly better implemented some other way than this, but this is good enough.