summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2022-02-10Shell script handlers by freq (#1166)Chris Lalos
Handlers for per-boot/per-instance/per-once multipart MIME Add handlers for adding scripts to userdata that can be run at various frequencies. Scripts of type x-shellscript-per-boot, x-shellscript-per-instance, or x-shellscript-per-once can be added to a multipart MIME userdata message as part of instance userdata. These scripts will then be added to the appropriate per-boot, per-instance, or per-once directory in /var/lib/cloud/scripts/ during processing of userdata.
2022-02-10add "eslerm" as contributor (#1258)Mark Esler
2022-02-03Add "slingamn" as contributor (#1235)Shivaram Lingamneni
2022-01-31Move LXD to end ds-identify DSLIST (#1228)James Falcon
LP: #1959118
2022-01-30Do not support setting up archive.canonical.com as a source (#1219)Steve Langasek
The partner archive is now obsolete. LP: #1959343
2022-01-28update ssh logs to show ssh private key gens pub and simplify code (#1221)Steve Weber
2022-01-20Update .github-cla-signers (#1204)Chris Lalos
2022-01-20Add support for gentoo templates and cloud.cfg (#1179)vteratipally
2022-01-18Add DatasourceOVF network-config propery to Ubuntu OVF example (#1184)Megian
Cloud-init includes the capability to take the network-config from a separate key. This removes the need to merge the network config in the user-data and make it more transparent in some cases. Reference: https://github.com/canonical/cloud-init/blob/42b938e8ff4c50833ff7b8f5acc1d9ab3f43ab18/cloudinit/sources/DataSourceOVF.py#L557
2022-01-14Test Optimization Proposal (SC-736) (#1188)Brett Holman
Reduce template rendering test runtime
2022-01-12Add new config module to set keyboard layout (#1176)maxnet
Adds a new module to allow setting keyboard layout, for use-cases in which cloud-init is used to configure OS images meant for physical computers instead of the cloud. This initial release only implements support for Linux distributions that allow layout to be set through systemd's localectl. LP: #1951593
2022-01-04Update cc_ubuntu_advantage calls to assume-yes (#1158)John Chittum
cloud-init currently makes calls to ubuntu_advantage without assume-yes. some ua enable commands, such as ua enable fips, have prompts. In an automated environment, calling ua enable without --assume-yes will result in errors and not applying the change. This sets --assume-yes by default for all enable commands. This capability was added two years ago in ua commit 576e605ceb5f so should be safe for use in all systems at this time. LP: #1954842
2021-12-15Adopt Black and isort (SC-700) (#1157)James Falcon
Applied Black and isort, fixed any linting issues, updated tox.ini and CI.
2021-12-13netbsd: install new dep packages (#1151)Gonéri Le Bouder
- netifaces - jsonschema
2021-12-09add KsenijaS as a contributor (#1145)Ksenija Stanojevic
2021-12-07Add miraclelinux support (#1128)Haruki TSURUMOTO
2021-11-18Add cjp256 as contributor (#1109)Chris Patterson
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-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-25Add module 'write-files-deferred' executed in stage 'final' (#916)Lucendio
The main idea is to introduce a second module that takes care of writing files, but in the 'final' stage. While the introduction of a second module would allow for choosing the appropriate place withing the order of modules (and stages), there is no addition top-level directive being added to the cloud configuration schema. Instead, 'write-files' schema is being extended to include a 'defer' attribute used only by the 'write-deffered-files' modules. The new module 'write-deferred-files' reuses as much as possible of the 'write-files' functionality.
2021-10-19Fix typos in setup.py (#1059)Christian Clauss
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-11VMWARE: search the deployPkg plugin in multiarch dir (#1061)xiaofengw-vmware
Due to multiarch, the libdeployPkgPlugin.so is deployed into dir /usr/lib/<multiarch name>/open-vm-tools, we need to add this path into search_paths. LP: #1944946
2021-10-07Allow comments in runcmd and report failed commands correctly (#1049)Brett Holman
Allow comments in runcmd and report failed commands correctly A `runcmd` script may fail to parse properly, but does not mark `runcmd` as failed when that occurs. Additionally `shellify()` fails to correctly parse scripts that contain a comment line. Rectify both issues and add unit tests to verify correct behavior. LP: #1853146
2021-10-04lp-to-git-users: adding vholer (#1044)Vlastimil Holer
Mapped from vlastimil-holer
2021-09-29Add andgein as contributor (#1042)Andrew Gein
2021-09-29Add jshen28 as contributor (#1035)jshen28
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-16Update IPv6 entries in /etc/hosts (#1021)Richard Hansen
Add IPv6 localhost (::1) entry. See: https://salsa.debian.org/installer-team/netcfg/-/blob/1767c9264e04652b9150ffc7b25568e4ea6b2bdd/netcfg.h#L42 https://salsa.debian.org/md/netbase/-/blob/9de8afcad482418cc4956dc09bbf6a2e8624d574/debian/netbase.postinst#L8 Also remove ip6-localnet, ip6-mcastprefix, and ip6-allhosts. See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499800 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688090 LP: #1943798
2021-09-14Add Jille to tools/.github-cla-signers (#1016)Jille Timmermans
2021-09-13Support openEuler OS (#1012)zhuzaifangxuele
openEuler Homepage: https://www.openeuler.org/en/
2021-09-02cc_update_etc_hosts: Use the distribution-defined path for the hosts file (#983)Andy Fiddaman
The distribution class has a field that specifies the location of the system hosts file and this can be overridden in subclasses. While the field is correctly used in distro.update_etc_hosts(), the update_etc_hosts module does not use it and just assumes '/etc/hosts' This fixes the module to use the distribution-specific variable.
2021-09-01Add CloudLinux OS support (#1003)Alexandr Kravchenko
https://www.cloudlinux.com/
2021-09-01Fix `make style-check` errors (#1000)Shreenidhi Shedi
Using flake8 inplace of pyflakes Renamed run-pyflakes -> run-flake8 Changed target name to flake8 in Makefile With pyflakes we can't suppress warnings/errors in few required places. flake8 is flexible in that regard. Hence using flake8 seems to be a better choice here. flake8 does the job of pep8 anyway. So, removed pep8 target from Makefile along with tools/run-pep8 script. Included setup.py in flake8 checks
2021-08-24Update ds-identify to pass shellcheck (#979)Andrew Kutz
This patch updates the ds-identify file to pass the popular shell linter, shellcheck. Updates include: * Global ignore for error code 3043, the warning about the "local" keyword not being POSIX compliant. This keyword is used everywhere and cannot be easily removed. * Point-of-use ignore for error code 3013, the warning about the "-nt" comparator not being POSIX compliant. There's no POSIX compliant way to compare timestamps on two files without forking a new process, so this comparator remains. * Several point-of-use ignores for error code 2254, the warning about quoting parameters. These warnings are ignored for the *_matches functions where wildcard tokens are expected to be used. Quoting the parameters would prevent the desired globbing and cause calls to these functions with wildcards to fail. * A point-of-use ignore for error code 2086 for the same reason as the above ignore -- allowing globbing to take place for matching. * Quoted parameters in the remainder of the locations where it was safe to do so and did not break the tests.
2021-08-16add Zadara Edge Cloud Platform to the supported clouds list (#963)sarahwzadara
2021-08-13Only invoke hotplug socket when functionality is enabled (#952)James Falcon
Alters hotplug hook to have a query mechanism checking if the functionality is enabled. This allows us to avoid using the hotplug socket and service when hotplug is disabled.
2021-08-13Revert unnecesary lcase in ds-identify (#978)Andrew Kutz
This patch reverts an unnecessary lcase optimization in the ds-identify script. SystemD documents the values produced by the systemd-detect-virt command are lower case, and the mapping table used by the FreeBSD check is also lower-case. The optimization added two new forked processes, needlessly causing overhead.
2021-08-12Update dscheck_VMware's rpctool check (#970)Shreenidhi Shedi
This patch updates the dscheck_VMware function's use of "vmware-rpctool". When checking to see if a "guestinfo" property is set. Because a successful exit code can occur even if there is an empty string returned, it is possible that the VMware datasource will be loaded as a false-positive. This patch ensures that in addition to validating the exit code, the emitted output is also examined to ensure a non-empty value is returned by rpctool before returning "${DS_FOUND}" from "dscheck_VMware()".
2021-08-10Add Puppet contributors to CLA signers (#964)Noah Fontes
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-08-03Implementing device_aliases as described in docs (#945)Mal Graty
Implement missing device_aliases feature The device_aliases key has been documented as part of disk_setup for years, however the feature was never implemented. This implements the feature as documented allowing usercfg (rather than dsconfig) to create a mapping of device names. This is not to be confused with disk_aliases, a very similar map but existing solely for use by datasources. LP: #1867532
2021-07-21Add VZLinux support (#951)eb3095
Virtuozzo Linux is a distro based off of CentOS 8, similar to Alma Linux and Rocky Linux.
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-13run-container: fixup the centos repos baseurls when using http_proxy (#944)Paride Legovini
The EPEL repo file used to have download.fedoraproject.org as its baseurl. That has now been replaced by `download.example`, which we need to replace with dl.fedoraproject.org, the actual mirror we want to download from. We can't use download.fedoraproject.org or the mirrorlist (which is the default way for finding mirrors) because of our internal proxy rules. This change only applies if http_proxy is set, otherwise the mirrors are reached in the default way.
2021-07-12tools: add support for building rpms on rocky linux (#940)Chad Smith
2021-07-05add renanrodrigo as a contributor (#938)Renan Rodrigo
2021-06-18Add support for VMware PhotonOS (#909)sshedi
Also added a new (currently experimental) systemd-networkd renderer, and includes a small refactor to cc_resolv_conf.py to support the resolved.conf used by systemd-resolved.
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).