summaryrefslogtreecommitdiff
path: root/cloudinit/config
AgeCommit message (Collapse)Author
2012-10-16Add in a configuration module that canJoshua Harlow
write out the yum.repo format for those that want to hook into different repos for installing.
2012-10-15Skip install when there is not configuration, and install the package to be ↵Thomas Hervé
setup properly.
2012-09-28Make byobu more tolerant of the user not beingJoshua Harlow
located and warn when it is not found + only run the shell command when actual contents exist to run.
2012-09-28Add a comment as to why distros can't beJoshua Harlow
imported without being renamed due to previous usage of the attribute 'distros'
2012-09-28Rework the rest of the locations that usedJoshua Harlow
the previous 'user' and make those locations go through the new distros functions to select the default user or the user list (depending on usage). Adjust the tests to check the new 'default' field that signifies the default user + test the new method to extract just the default user from a normalized user dictionary.
2012-09-28restart salt-minion instead of start.Scott Moser
Packages on debian/ubuntu should start on installation. As a result, if we want to get config changes we've inserted to be read, we need to restart. Note one interesting thing here. upstart considers 'restart' as "restart only if currently running", while 'service' considers restart to be "stop if running, then start". So the use of 'service' here is important, rather than just 'restart'
2012-09-27cleanup the user/group listsJoshua Harlow
The primary utility here is normalize_user_groups, which would be called by config modules to get a list of users or groups. This centralizes what was copied code into this one location.
2012-09-24Adjust the fingerprints to use this newJoshua Harlow
user normalization function instead of the previous 'user' extraction.
2012-09-24Refactor the ug normalization to take in a distroJoshua Harlow
and produce a user and group list. Clean this up to be simpler as well as handle the old 'user' case when it exists in configuration.
2012-09-23Make the normalization a module level functionJoshua Harlow
since it has little dependence on the distros class itself. Readjust the using code to use this new module level function instead.
2012-09-21Fix some docs + pylint warnings + log on default created in the module.Joshua Harlow
2012-09-211. Cleanup the user creation so that the distro class isJoshua Harlow
responsible only for creating users and groups and normalizing a input configuration into a normalized format that splits up the user list, the group list and the default user listsand let the add user/group config module handle calling those methods to add its own users/groups and the default user (if any). 2. Also add in tests for this normalization process to ensure that it is pretty bug free and works with the different types of formats that users/groups/defaults + options can take.
2012-09-14only write landscape config if user-data providedScott Moser
2012-09-06do not convert type None to string in cfgmnt.Scott Moser
LP: #1046946
2012-09-05Check if the config was specifiedThomas Hervé
2012-09-05Add RUN=1 to the default fileThomas Hervé
2012-08-31Removed admin group from default Ubuntu user group list.Ben Howard
Fixed change password behavior to work with new user list handling (LP: #1044553)
2012-08-31fix pylint warningScott Moser
2012-08-31- Converted user list to user dict to allow exclusion of the default userBen Howard
on Ubuntu systems via cloud-config (LP: #1041384). - Fixed bug with user creation on Ubuntu where the default user groups are not set properly (LP: #1044044). - Fixed documentation for user creation (LP: #1044508).
2012-08-28fix busted cc_ssh_import_idScott 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-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-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-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-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-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-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-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-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-03use get_cfg_option_bool for apt_mirror_search_dnsScott Moser
2012-08-03do not search for mirror named '<distro>-mirror' in dns by defaultScott Moser
As described in the bug, enough non-cloud users experienced issues with cloud-init selecting a mirror due to consumer level network providers using dns server redirection. We're turning this off by default. LP: #974509
2012-07-11add write-files module for "injecting" files (LP: #1012854)Scott Moser
This implements file writing via cloud-config. It also * adjusts other code to have user/group parsing in util instead of in stages.py, * renames decomp_str to decomp_gzip since it is more meaningful when named that (as thats all it can decompress). LP: #1012854
2012-07-11Update the write files with the new content/compression handling.Joshua Harlow
Adjust the examples file to reflect this.
2012-07-11Fix log message after 'write_files' key change.Joshua Harlow