summaryrefslogtreecommitdiff
path: root/config
AgeCommit message (Collapse)Author
2016-10-20Add support for snap create-user on Ubuntu Core images.Ryan Harper
Ubuntu Core images use the `snap create-user` to add users to an Ubuntu Core system. Add support for creating snap users by adding a key to the users dictionary. users: - name: bob snapuser: bob@bobcom.io Or via the 'snappy' dictionary: snappy: email: bob@bobcom.io Users may also create a snap user without contacting the SSO by providing a 'system-user' assertion by importing them into snapd. Additionally, Ubuntu Core systems have a read-only /etc/passwd such that the normal useradd/groupadd commands do not function without an additional flag, '--extrausers', which redirects the pwd to /var/lib/extrausers. Move the system_is_snappy() check from cc_snappy module to util for re-use and then update the Distro class to append '--extrausers' if the system is Ubuntu Core.
2016-09-28ntp: move to run after apt configurationScott Moser
since ntp module may try to install packages, it needs to run after apt is configured. LP: #1628337
2016-09-20Adjust mounts and disk configuration for systemd.Scott Moser
The end result of all of these changes is to get mounts managed by cloud-init to occur only after cloud-init.service is done. We need to do that so that filesystems that are set up by cloud-init (in disk_setup) do not get mounted by stale entries in /etc/fstab before the setup occurs. This can occur in 2 ways: a.) new instance with old /etc/fstab b.) same instance where disk needs adjusting (Azure resize will re-format the ephemeral disk). The list of changes here is: - move mounts and disk_setup module to cloud-init.service rather than config. cloud-init.service runs earlier in boot so it can get those mount points done earlier. - on systemd add 'x-systemd.requires=cloud-init.service' to fstab options - cloud-init-local.service: add Before=basic.target - cloud-init.service: - extend After, Before, and Wants to multiple lines rather than one long line. - sort consistently with cloud-init-local.service - add DefaultDependencies=no - add Before=default.target - add Conflicts=shutdown.target LP: #1611074
2016-09-09systemd: Better support package and upgrade.Scott Moser
In systemd, package installation before the system is fully booted (systemctl is-system-running == starting) may result in the package not being started. Upgrade (package_upgrade: true) can also cause failure if that is done during systemd boot. The solution here is: a.) move config modules that do or may do package installation to 'final_modules'. That list is: - snappy - package-update-upgrade-install - fan - landscape - lxd - puppet - chef - salt-minion - mcollective b.) move cloud-final.service to run as 'Type=idle' LP: #1576692, #1621336
2016-08-22azure dhclient-hook cleanupsScott Moser
This adds some function to the generator to maintain the presense of a flag file '/run/cloud-init/enabled' indicating that cloud-init is enabled. Then, only run the dhclient hooks if on Azure and cloud-init is enabled. The test for is_azure currently only checks to see that the board vendor is Microsoft, not actually that we are on azure. Running should not be harmful anywhere, other than slowing down dhclient. The value of this additional code is that then dhclient having run does not task the system with the load of cloud-init. Additionally, some changes to config are done here. * rename 'dhclient_leases' to 'dhclient_lease_file' * move that to the datasource config (datasource/Azure/dhclient_lease_file) Also, it removes the config in config/cloud.cfg that set agent_command to __builtin__. This means that by default cloud-init still needs the agent installed. The suggested follow-on improvement is to use __builtin__ if there is no walinux-agent installed.
2016-08-15Get Azure endpoint server from DHCP clientBrent Baude
It is more efficient and cross-distribution safe to use the hooks function from dhclient to obtain the Azure endpoint server (DHCP option 245). This is done by providing shell scritps that are called by the hooks infrastructure of both dhclient and NetworkManager. The hooks then invoke 'cloud-init dhclient-hook' that maintains json data with the dhclient options in /run/cloud-init/dhclient.hooks/<interface>.json . The azure helper then pulls the value from /run/cloud-init/dhclient.hooks/<interface>.json file(s). If that file does not exist or the value is not present, it will then fall back to the original method of scraping the dhcp client lease file.
2016-08-10add ntp config moduleRyan Harper
Add support for installing and configuring ntp service, exposing the minimum config of servers or pools to be added. If none are defined then fallback on generating a list of pools by distro hosted at pool.ntp.org (which matches what's found in the default ntp.conf shipped in the respective distro).
2016-04-04merge with trunkScott Moser
2016-03-09Add default ubuntu user to lxd group (LP: #1539317)Robert Jennings
LP: #1539317
2016-02-03lxd: add support for setting up lxd using 'lxd init'Wesley Wiedenmeier
If lxd key is present in cfg, then run 'lxd init' with values from the 'init' entry in lxd configuration as flags.
2015-10-09support configuring and installing the Ubuntu fan driverScott Moser
#cloud-config fan: config: | # fan 240 10.0.0.0/8 eth0/16 dhcp 10.0.0.0/8 eth1/16 dhcp off # fan 241 241.0.0.0/8 eth0/16 dhcp config_path: /etc/network/fan LP: #1504604
2015-07-22Add DataSource.region and use it in mirror selection.Daniel Watkins
Also implement DataSource.region for EC2 and GCE data sources.
2015-03-04add snappy moduleScott Moser
2015-01-20More FreeBSD improvementsBen Arblaster
- Implement set_passwd - Implement set_timezone - Use /bin/tcsh as default user shell (FreeBSD default) - Change default username to freebsd - Enable set-passwords, package-update-upgrade-install and timezone modules - Remove trailing whitespace
2014-10-08new: The Ec2 datasource works for FreeBSD as well.Harm Weites
2014-09-29add ConfigDrive for freebsd config by defaultScott Moser
2014-08-23change: Rename the config file to cloud.cfg-freebsd so it doesn'tHarm Weites
get copied per default. Packaging will take care of installing this configfile on the BSD platform.
2014-08-13change: Run the ssh module.Harm Weites
2014-08-10change: Cancel execution of several modules that are definately notHarm Weites
tested or supported yet.
2014-08-09change: Add an important comment.Harm Weites
2014-08-08new: Config for FreeBSD.Harm Weites
This doesn't differ much from the regular (linux) config, but currently it helps while testing and setting up fbsd cloud instances.
2014-07-31initial commit oif iniit_switchScott Moser
2014-01-15remove vendor-scripts-per-{boot,instance,once}Scott Moser
I don't see a real need for these. The intent of the 'per-boot' or 'per-instance' or 'per-once' config modules is to handle running scripts that were already inserted into the instance. If the vendor is doing that, then there is value in vendor-data. Ie, they'd already modified the image, they might as well have just put the stuff in that they wanted.
2014-01-15config/cloud.cfg: fix typoScott Moser
2014-01-15merge from trunkScott Moser
2014-01-14provide default 'output' setting to log to /var/log/cloud-init-output.logScott Moser
This has been "best practice" for quite some time, and its a common request of "where is the output of my user-data programs". http://askubuntu.com/questions/345344/where-are-the-logs-for-my-user-data-script-cloud-init
2014-01-08Significant re-working of the userdata handling and introduction ofBen Howard
vendordata. Vendordata is a datasource provided userdata-like blob that is parsed similiarly to userdata, execept at the user's pleasure. cloudinit/config/cc_scripts_vendor.py: added vendor script cloud config cloudinit/config/cc_vendor_scripts_per_boot.py: added vendor per boot cloud config cloudinit/config/cc_vendor_scripts_per_instance.py: added vendor per instance vendor cloud config cloudinit/config/cc_vendor_scripts_per_once.py: added per once vendor cloud config script doc/examples/cloud-config-vendor-data.txt: documentation of vendor-data examples doc/vendordata.txt: documentation of vendordata for vendors (RENAMED) tests/unittests/test_userdata.py => tests/unittests/test_userdata.py TO: tests/unittests/test_userdata.py => tests/unittests/test_data.py: userdata test cases are not expanded to confirm superiority over vendor data. bin/cloud-init: change instances of 'consume_userdata' to 'consume_data' cloudinit/handlers/cloud_config.py: Added vendor script handling to default cloud-config modules cloudinit/handlers/shell_script.py: Added ability to change the path key to support vendor provided 'vendor-scripts'. Defaults to 'script'. cloudinit/helpers.py: - Changed ConfigMerger to include handling of vendordata. - Changed helpers to include paths for vendordata. cloudinit/sources/__init__.py: Added functions for helping vendordata - get_vendordata_raw(): returns vendordata unprocessed - get_vendordata(): returns vendordata through userdata processor - has_vendordata(): indicator if vendordata is present - consume_vendordata(): datasource directive for indicating explict user approval of vendordata consumption. Defaults to 'false' cloudinit/stages.py: Re-jiggered for handling of vendordata - _initial_subdirs(): added vendor script definition - update(): added self._store_vendordata() - [ADDED] _store_vendordata(): store vendordata - _get_default_handlers(): modified to allow for filtering which handlers will run against vendordata - [ADDED] _do_handlers(): moved logic from consume_userdata to _do_handlers(). This allows _consume_vendordata() and _consume_userdata() to use the same code path. - [RENAMED] consume_userdata() to _consume_userdata() - [ADDED] _consume_vendordata() for handling vendordata - run after userdata to get user cloud-config - uses ConfigMerger to get the configuration from the instance perspective about whether or not to use vendordata - [ADDED] consume_data() to call _consume_{user,vendor}data cloudinit/util.py: - [ADDED] get_nested_option_as_list() used by cc_vendor* for getting a nested value from a dict and returned as a list - runparts(): added 'exe_prefix' for running exe with a prefix, used by cc_vendor* config/cloud.cfg: Added vendor script execution as default tests/unittests/test_runs/test_merge_run.py: changed consume_userdata() to consume_data() tests/unittests/test_runs/test_simple_run.py: changed consume_userdata() to consume_data()
2013-09-30add default user to 'sudo' group.Scott Moser
Ubuntu images in 12.04 added the user to the 'admin' group. The admin group was deprecated/replaced with the 'sudo' group in 12.10. d-i adds its first-user to the 'sudo' group, so it makes sense to mimic that behavior for the default user created by cloud-init. That was the original reason behind the presense in the 'admin' group. Also, here I sorted alphabetically the group list. LP: #1228228
2013-09-30Fix for default user not being in the sudo group (LP: #1228228).Ben Howard
2013-09-19Fixes for the MP.Ben Howard
Changed cc_disk_setup to handle the file systems as a label, no longer passing "log" around. Tidied up the documentation to reflect the changes and made grammer, spelling and improved the content a little. Added disk_setup to the default modules list.
2013-09-11Initial cut at disk partition support.Ben Howard
2013-09-03Review adjustments.Joshua Harlow
2013-03-01initial stab at growpart moduleScott Moser
LP: #1136936
2012-11-19add 'sudo' entry for default user in default config/cloud.cfgScott Moser
LP: #1080717
2012-11-14set shell for default ubuntu user to /bin/bashScott Moser
2012-11-13support 'power_state' cloud-config for specifying shutdownScott Moser
this adds 'power-state-change' config module that allows the user to specify in cloud-config syntax that a system reboot or shutdown should occur after cloud-init is done.
2012-11-13'name' for default user must be all lower case.Scott Moser
if 'name' for the user had something other than all lower case, then pwd.getpwname would fail.
2012-11-13rename module 'finalcmd' to power-state-changeScott Moser
2012-11-12add 'finalcmd' module for running code after cloud-init-finalScott Moser
This allows the user to easily run stuff even after cloud-init-final has finished. The initial reason for it is to be able to run /sbin/poweroff and not have cloud-init complain loudly that it is being killed. LP: #1064665
2012-11-07Start adding a 'migrator' moduleJoshua Harlow
that can be used to aid in the moving of older versions of cloud-inits data to newer versions of cloud-inits data. 1. Move the semaphores for the current instance to there canonicalized names and use the canonicalized in the file 'locking' code
2012-11-07merge from trunkScott Moser
2012-11-07update config to address name changeScott Moser
2012-10-23tweak default ubuntu userScott Moser
2012-10-23move default user info out of code and into configScott Moser
Remove the need to have 'default_user' and 'default_user_groups' groups be hard coded into the distro class, instead let that set of configuration be located in the config file where it should be specified instead.
2012-09-20Remove the need to have 'default_user' andJoshua Harlow
'default_user_groups' groups be hard coded into the distro class, instead let that set of configuration be located in the config file where it should be specified instead.
2012-09-19Fix ports.ubuntu.com mirror locationsRobie Basak
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-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-22Merge with lp:cloud-initBen Howard
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.