summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-24add support for the config-drive-v2 datasourceScott Moser
config-drive-v2 was implemented in openstack at https://review.openstack.org/#/c/11184/ . This adds support to cloud-init for reading that. LP: #1037567
2012-08-24add changelog entryScott Moser
2012-08-24fix test case for copy of uuid -> instance-idScott Moser
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-22add support for creating initial users and groupsScott Moser
Added "userless" mode to cloud-init for handling the creation of the users and the default user on Ubuntu. The end goal of this is to remove the need for the 'ubuntu' user in the cloud images and to allow individuals to choose the default user name. LP: #1028503
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-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) * 'ec2_region' substitution variable is present only if this appears (by availability-zone naming convention) to be in EC2. * 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. * package_mirrors is now required in the system_info config, a dict like: package_mirrors: - arches: [i386, amd64] failsafe: primary: http://archive.ubuntu.com/ubuntu security: http://security.ubuntu.com/ubuntu search: primary: - http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/ - http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/ security: [] - arches: [armhf, armel, default] failsafe: primary: http://ports.ubuntu.com/ubuntu security: http://ports.ubuntu.com/ubuntu LP: #1006963, #1028501, #1037727
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-22add testScott 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-20fix config for proper spelling of 'authkey'Scott Moser
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-20mark bug 1010582 as fixed.Scott Moser
This was fixed in the previous commit, but not marked explicitly as such. LP: #1010582
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-14doc: move datasource documentation to doc/sourcesScott Moser
Each datasource had a bit of doc with it, and those were just landing in doc/. I've moved them to doc/sources now.