summaryrefslogtreecommitdiff
path: root/doc
AgeCommit message (Collapse)Author
2021-12-02jinja: provide and document jinja-safe key aliases in instance-data (SC-622) ↵Chad Smith
(#1123) Allow #cloud-config and cloud-init query to use underscore-delimited "jinja-safe" key aliases for any instance-data.json keys containing jinja operator characters. This provides a means to use Jinja's dot-notation instead of square brackets and quoting to reference "unsafe" obtain attribute names. Support for these aliased keys is available to both #cloud-config user-data and `cloud-init query`. For example #cloud-config alias access can look like: {{ ds.config.user_network_config }} - instead of - {{ ds.config["user.network-config"] }}
2021-11-29sources/azure: remove unused remnants related to agent command (#1119)Chris Patterson
Some references were missed in the removal of the agent command in PR #799. This simply removes the remaining references. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
2021-11-22docs: Rename HACKING.rst to CONTRIBUTING.rst (#1118)James Falcon
This is more consistent with other github repositories, and will prompt a first-time contributor to read the contributing guidelines before submitting the pull request. Additionally, added a summary section to the top, updated some outdated language, and removed some outdated typing guidance.
2021-11-01Add LXD datasource (#1040)Chad Smith
Add DataSourceLXD which knows how to talk to the dev-lxd socket to obtain all instance metadata API: https://linuxcontainers.org/lxd/docs/master/dev-lxd. This first branch is to deliver feature parity with the existing NoCloud datasource which is currently used to intialize LXC instances on first boot. Introduce a SocketConnectionPool and LXDSocketAdapter to support performing HTTP GETs on the following routes which are surfaced by the LXD host to all containers: http://unix.socket/1.0/meta-data http://unix.socket/1.0/config/user.user-data http://unix.socket/1.0/config/user.network-config http://unix.socket/1.0/config/user.vendor-data These 4 routes minimally replace the static content provided in the following nocloud-net seed files: /var/lib/cloud/nocloud-net/{meta-data,vendor-data,user-data,network-config} The intent of this commit is to set a foundation for LXD socket communication that will allow us to build network hot-plug features by eventually consuming LXD's websocket upgrade route 1.0/events to react to network, meta-data and user-data config changes over time. In the event that no custom network-config is provided, default to the same network-config definition provided by LXD to the NoCloud network-config seed file. Supplemental features above NoCloud datasource: surface all custom instance data config keys via cloud-init query ds which aids in discoverability of features/tags/labels as well as conditional #cloud-config jinja templates operations based on custom config options. TBD: better cloud-init query support for dot-delimited keys
2021-11-01Fix unhandled apt_configure case. (#1065)Brett Holman
Don't throw an exception when mirror arch is unspecified.
2021-10-29Remove (deprecated) apt-key (#1068)Brett Holman
Also, add the "signed by" option to source definitions. This enables users to limit the scope of trust for individual keys. LP: #1836336
2021-10-27Add "install hotplug" module (SC-476) (#1069)James Falcon
This commit removes automatically installing udev rules for hotplug and adds a module to install them instead. Automatically including the udev rules and checking if hotplug was enabled consumed too many resources in certain circumstances. Moving the rules to a module ensures we don't spend extra extra cycles on hotplug if hotplug functionality isn't desired. LP: #1946003
2021-10-18VMware: read network-config from ISO (#1066)Thomas Weißschuh
There is no reason for the ISO missing this functionality. As discussed in https://github.com/canonical/cloud-init/pull/947/files#r707338489
2021-10-07Allow disabling of network activation (SC-307) (#1048)James Falcon
In #919 (81299de), we refactored some of the code used to bring up networks across distros. Previously, the call to bring up network interfaces during 'init' stage unintentionally resulted in a no-op such that network interfaces were NEVER brought up by cloud-init, even if new network interfaces were found after crawling the metadata. The code was altered to bring up these discovered network interfaces. On ubuntu, this results in a 'netplan apply' call during 'init' stage for any ubuntu-based distro on a datasource that has a NETWORK dependency. On GCE, this additional 'netplan apply' conflicts with the google-guest-agent service, resulting in an instance that can no be connected to. This commit adds a 'disable_network_activation' option that can be enabled in /etc/cloud.cfg to disable the activation of network interfaces in 'init' stage. LP: #1938299
2021-10-07Support ETHx_IP6_GATEWAY, SET_HOSTNAME on OpenNebula (#1045)Vlastimil Holer
OpenNebula 6.1.80 (current dev. version) is introducing new IPv6 gateway contextualization variable ETHx_IP6_GATEWAY, which mimics existing variable ETHx_GATEWAY6. The ETHx_GATEWAY6 used until now will be depracated in future relase (ET spring 2022). See: - new variable - https://github.com/OpenNebula/one/commit/e4d2cc11b9f3c6d01b53774b831f48d9d089c1cc - deprecation tracking issue - https://github.com/OpenNebula/one/issues/5536 Also, added support for SET_HOSTNAME context variable, which is currently widely used variable to configure guest VM hostname. See https://docs.opennebula.io/6.0/management_and_operations/references/template.html#context-section
2021-09-29testing: remove cloud_tests (#1020)James Falcon
Cloud tests have been replaced with integration tests
2021-09-24Remove invalid ssh_import_id from examples (#1031)James Falcon
2021-09-20Add retries to DataSourceGCE.py when connecting to GCE (#1005)vteratipally
Add retries to DatasourceGCE when connecting to GCE. Sometimes when the trying to fetch the metadata, cloud-init fails and the fallback datasource NoCloud is used which is not expected. Add retries to ensure loading of the data source.
2021-09-17docs: fix typo and include sudo for report bugs commands (#1022)Renan Rodrigo
Remove a duplicate "a" in the docs, and change the bug reporting documentation to tell users to run the commands with sudo. LP: #1940236
2021-08-31Make cloud-id copyright year (#991)Andrii Podanenko
2021-08-16add Zadara Edge Cloud Platform to the supported clouds list (#963)sarahwzadara
2021-08-10cc_puppet: support AIO installations and more (#960)Gabriel Nagy
- update the puppet module to support AIO installations by setting `install_type` to `aio` - make the install collection configurable through the `collection` parameter; by default the rolling `puppet` collection will be used, which installs the latest version) - when `install_type` is `aio`, puppetlabs repos will be purged after installation; set `cleanup` to `False` to prevent this - AIO installations are performed by downloading and executing a shell script; the URL for this script can be overridden using the `aio_install_url` parameter - make it possible to run puppet agent after installation/configuration via the `exec` key - by default, puppet agent will run with the `--test` argument; this can be overridden via the `exec_args` key
2021-08-09Datasource for VMware (#953)Andrew Kutz
This patch finally introduces the Cloud-Init Datasource for VMware GuestInfo as a part of cloud-init proper. This datasource has existed since 2018, and rapidly became the de facto datasource for developers working with Packer, Terraform, for projects like kube-image-builder, and the de jure datasource for Photon OS. The major change to the datasource from its previous incarnation is the name. Now named DatasourceVMware, this new version of the datasource will allow multiple transport types in addition to GuestInfo keys. This datasource includes several unique features developed to address real-world situations: * Support for reading any key (metadata, userdata, vendordata) both from the guestinfo table when running on a VM in vSphere as well as from an environment variable when running inside of a container, useful for rapid dev/test. * Allows booting with DHCP while still providing full participation in Cloud-Init instance data and Jinja queries. The netifaces library provides the ability to inspect the network after it is online, and the runtime network configuration is then merged into the existing metadata and persisted to disk. * Advertises the local_ipv4 and local_ipv6 addresses via guestinfo as well. This is useful as Guest Tools is not always able to identify what would be considered the local address. The primary author and current steward of this datasource spoke at Cloud-Init Con 2020 where there was interest in contributing this datasource to the Cloud-Init codebase. The datasource currently lives in its own GitHub repository at https://github.com/vmware/cloud-init-vmware-guestinfo. Once the datasource is merged into Cloud-Init, the old repository will be deprecated.
2021-08-05Add support for EuroLinux 7 && EuroLinux 8 (#957)Aleksander Baranowski
2021-07-23Add ability to manage fallback network config on PhotonOS (#941)sshedi
Currently cloud-init generates fallback network config on various scenarios. For example: 1. When no DS found 2. There is no 'network' info given in DS metadata. 3. If a DS gives a network config once and upon reboot if DS doesn't give any network info, previously set network data will be overridden. A newly introduced key in cloud.cfg.tmpl can be used to control this behavior on PhotonOS. Also, if OS comes with a set of default network files(configs), like in PhotonOS, cloud-init should not overwrite them by default. This change also includes some nitpicking changes of reorganizing few config variables. Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
2021-07-20VMware: add network-config support in ovf-env.xml (#947)PengpengSun
Details: 1. Support guest set network config through guestinfo.ovfEnv using OVF 2. 'network-config' Property is optional 3. 'network-config' Property's value has to be base64 encoded Added unittests and updated ovf-env.xml example
2021-07-19Document known hotplug limitations (#950)James Falcon
2021-07-19Initial hotplug support (#936)James Falcon
Adds a udev script which will invoke a hotplug hook script on all net add events. The script will write some udev arguments to a systemd FIFO socket (to ensure we have only instance of cloud-init running at a time), which is then read by a new service that calls a new 'cloud-init devel hotplug-hook' command to handle the new event. This hotplug-hook command will: - Fetch the pickled datsource - Verify that the hotplug event is supported/enabled - Update the metadata for the datasource - Ensure the hotplugged device exists within the datasource - Apply the config change on the datasource metadata - Bring up the new interface (or apply global network configuration) - Save the updated metadata back to the pickle cache Also scattered in some unrelated typing where helpful
2021-07-08VMware: new "allow_raw_data" switch (#939)xiaofengw-vmware
Add a new switch allow_raw_data to control raw data feature, update the documentation. Fix bugs about max_wait.
2021-06-17docs: fix stale links rename master branch to main (#926)Chad Smith
Update doc references to 'main' default branch due to rename. Also some links have eroded: - for doc links directly to a line num link to a blob/<commit>/file/path#L10 instead of blob/<branch_name>. - pytest.param link to a specific version doc as latest has dropped the link
2021-06-17Fix DNS in NetworkState (SC-133) (#923)James Falcon
v1 network config currently has no concept of interface-specific DNS, which is required for certain renderers. To fix this, added an optional 'interface' key on the v1 nameserver definition. If specified, it makes the DNS settings specific to the interface. Otherwise, it will be defined as global DNS as it always has. Additionally, DNS for v2 wasn't being recognized correctly. For DNS defined on a particular interface, these settings now also go into the global DNS settings as they were intended.
2021-06-17Fix the spelling of "DigitalOcean" (#924)Mark Mercado
The name "DigitalOcean" doesn't have a space in it; it's a single compound word written in Pascal case (upper camel case).
2021-06-14add DragonFlyBSD support (#904)Gonéri Le Bouder
- Mostly based on FreeBSD, the main exception is that `find_devs_with_on_freebsd` does not work. - Since we cannot get the CDROM or the partition labels, `find_devs_with_on_dragonflybsd()` has a more naive approach and returns all the block devices.
2021-06-10Use instance-data-sensitive.json in jinja templates (SC-117) (#917)James Falcon
instance-data.json redacts sensitive data for non-root users. Since user data is consumed as root, we should be consuming the non-redacted data instead. LP: #1931392
2021-06-10doc: Update NoCloud docs stating required files (#918)James Falcon
LP: #1931577
2021-05-27Docs: Replace all freenode references with libera (#912)James Falcon
2021-05-18Added support for importing keys via primary/security mirror clauses (#882)Paul Goins
Presently, mirror keys cannot be associated with primary/security mirrors. Unfortunately, this prevents use of Landscape-managed package mirrors as the mirror key for the Landscape-hosted repository cannot be provided. This patch allows the same key-related fields usable on "sources" entries to be used on the "primary" and "security" entries as well. LP: #1925395
2021-05-14[examples] config-user-groups expire in the future (#902)Geert Stappers
Changed year 2012 into 2032
2021-05-13Allow user control over update events (#834)James Falcon
Control is currently limited to boot events, though this should allow us to more easily incorporate HOTPLUG support. Disabling 'instance-first-boot' is not supported as we apply networking config too early in boot to have processed userdata (along with the fact that this would be a pretty big foot-gun). The concept of update events on datasource has been split into supported update events and default update events. Defaults will be used if there is no user-defined update events, but user-defined events won't be supplied if they aren't supported. When applying the networking config, we now check to see if the event is supported by the datasource as well as if it is enabled. Configuration looks like: updates: network: when: ['boot']
2021-05-03Revert "Add support to resize rootfs if using LVM (#721)" (#887)Daniel Watkins
This reverts commit 74fa008bfcd3263eb691cc0b3f7a055b17569f8b. During pre-release testing, we discovered two issues with this commit. Firstly, there's a typo in the udevadm command that causes a TypeError for _all_ growpart executions. Secondly, the LVM resizing does not appear to successfully resize everything up to the LV, though some things do get resized. We certainly want this change, so we'll be happy to review and land it alongside an integration test which confirms that it is working as expected. LP: #1922742
2021-04-14doc: Replace remaining references to user-scripts as a config module (#866)Ryan Harper
git-grep showed a few more locations where we refer to a "user-scripts" config module which is really cc_scripts_user module. Replace these references with slightly different language so as not to confuse future me when looking for "user-scripts" vs. "scripts-user"
2021-04-13azure: Removing ability to invoke walinuxagent (#799)Anh Vo
Invoking walinuxagent from within cloud-init is no longer supported/necessary
2021-04-13Add Vultr support (#827)David Dymko
This PR adds in support so that cloud-init can run on instances deployed on Vultr cloud. This was originally brought up in #628. Co-authored-by: Eric Benner <ebenner@vultr.com>
2021-03-30Add support to resize rootfs if using LVM (#721)Eduardo Otubo
This patch adds support to resize a single partition of a VM if it's using an LVM underneath. The patch detects if it's LVM if the given block device is a device mapper by its name (e.g. `/dev/dm-1`) and if it has slave devices under it on sysfs. After that syspath is updated to the real block device and growpart will be called to resize it (and automatically its Physical Volume). The Volume Group will be updated automatically and a final call to extend the rootfs to the remaining space available will be made. Using the same growpart configuration, the user can specify only one device to be resized when using LVM and growpart, otherwise cloud-init won't know which one should be resized and will fail. rhbz: #1810878 LP: #1799953 Signed-off-by: Eduardo Otubo <otubo@redhat.com> Signed-off-by: Scott Moser <smoser@brickies.net>
2021-03-24Fix chef apt source example (#826)timothegenzmer
key is a property of source1 and not sources
2021-03-08Remove the vi comment from the part-handler example (#835)James Falcon
2021-02-25doc: remove duplicate "it" from nocloud.rst (#825)V.I. Wood
2021-02-22cc_keys_to_console: add option to disable key emission (#811)Michael Hudson-Doyle
Specifically: ssh: emit_keys_to_console: false We also port the cc_keys_to_console cloud tests to the new integration testing framework, and add a test for this new option. LP: #1915460
2021-02-08Datasource for UpCloud (#743)Antti Myyrä
New datasource utilizing UpCloud metadata API, including relevant unit tests and documentation.
2021-02-05openstack: read the dynamic metadata group vendor_data2.json (#777)Andrew Bogott
Add support for openstack's dynamic vendor data, which appears under openstack/latest/vendor_data2.json This adds vendor_data2 to all pathways; it should be a no-op for non-OpenStack providers. LP: #1841104
2021-01-27[VMware] change default max wait time to 15s (#774)xiaofengw-vmware
If cloud-init is enabled on VMware platform, cloud-init will wait until its configuration file is ready and currently the max wait is 90 seconds by default. With our test, this configuration file should be ready within 1 second, so change it to 15 seconds for better performance. Also update the documentation about how to change the default value in cloud-init configuration file.
2021-01-21doc: avoid two warnings (#781)Dan Kenigsberg
Two shell code blocks are not marked as such, confusing rst to consider them as yaml. Be explicit about their syntax, and use $ prompt to match elsewhere in the docs. /home/travis/build/canonical/cloud-init/doc/rtd/topics/format.rst:28: WARNING: Could not lex literal_block as "yaml". Highlighting skipped. /home/travis/build/canonical/cloud-init/doc/rtd/topics/format.rst:52: WARNING: Could not lex literal_block as "yaml". Highlighting skipped. Signed-off-by: Dan Kenigsberg <danken@redhat.com>
2021-01-20Use proper spelling for Red Hat (#778)Dan Kenigsberg
The company name has two distinct words. Signed-off-by: Dan Kenigsberg <danken@redhat.com>
2021-01-07doc: document missing IPv6 subnet types (#744)Antti Myyrä
Added some missing IPv6 subnet configuration types (ipv6_dhcpv6-stateful, ipv6_dhcpv6-stateless, ipv6_slaac) to Networking config v1 documentation.
2021-01-07Add example configuration for datasource `AliYun` (#751)Xiaoyu Zhong