summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * cc_puppet: Update puppet service name (#1970)d1r3ct0r2023-02-013-103/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cc_puppet: Update puppet service name to puppet-agent From Lunar, we see that the default puppet version is 7.20 which replaces `puppet.service` with `puppet-agent.service`. Thus, we need to have a way of calling the appropriate service depending on the distribution of puppet installed. Attempt to install, start or enable puppet-agent first and fallback to puppet. Log warnings if neither preferred package names exist or if the package_name in user-data is not able to be configured. LP: #2002969
| * docs: Clarify networking docs (#1987)Brett Holman2023-01-312-8/+15
| | | | | | | | - Add stronger warnings for resolv_conf module. - Add link to lxd network config docs.
| * lint: remove httpretty (#1985)sxt10012023-01-311-1/+0
| | | | | | | | | | Drop httpretty from list of ignored modules to type-check. This module was dropped in favor of responses.
| * cc_set_passwords: Prevent traceback when restarting ssh (#1981)James Falcon2023-01-302-15/+19
| | | | | | | | | | On Bionic in GCE, when restarting ssh, it's not uncommon to see a traceback with `ssh.service is not active, cannot reload.`. Instead log a warning.
| * tests: fix lp1912844 (#1978)Alberto Contreras2023-01-301-1/+1
| | | | | | | | Fix test_lp1912844.py where the intance's ip was not correctly detected in pycloudlib
| * tests: Skip ansible test on bionic (#1984)James Falcon2023-01-301-0/+3
| | | | | | Bionic will no longer be supported by version in pip
| * Wait for NetworkManager (#1983)Robert Schweikert2023-01-301-1/+2
| | | | | | | | | | Newer SUSE distributions are switching to NetworkManager from wicked. For those distributions we need to wait for NetworkManager before starting the cloud-init service.
| * docs: minor polishing (#1979)s-makin2023-01-275-7/+11
| | | | | | | | | | | | | | | | | | | | Minor changes for Diataxis: 1) Added "reverse" to front page section blocks so they display correctly on mobile/smaller screens. 2) Added links to security/performance pages from Explanation section. These were linking directly to the pages in the Development section and will eventually become more like signposts as more content is added/revised.
| * CI: migrate integration-test to GH actions (#1969)Alberto Contreras2023-01-262-105/+84
| | | | | | | | | | | | | | changes: - drop caching machinery for LXD images and chroots - divide the workflow in two steps, one for building packages and other for running the tests so that the second one can be retried in case of error
| * Fix permission of SSH host keys (#1971)Ron Gebauer2023-01-253-5/+6
| | | | | | | | | | | | | | | | | | If the host-keys are provided the private key permissions have 0600 which is indeed correct. But the public key has 0600 which should instead be 0644. With this change the public key is always 0644 and the private key is 0600 if provided or 640 if generated (to match sshd-keygen functionality).
| * Fix default route rendering on v2 ipv6 (#1973)James Falcon2023-01-242-2/+2
| | | | | | | | | | | | ::/0 would get rendered as ::/64 rather than ::/0 across all renderers using ipv6 in a v2 config. LP: #2003562
| * doc: fix path in net_convert command (#1975)Brett Holman2023-01-231-1/+1
| |
| * docs: update net_convert docs (#1974)Brett Holman2023-01-231-11/+18
| |
| * doc: fix dead linkBrett Holman2023-01-201-1/+1
| |
| * cc_set_hostname: ignore /var/lib/cloud/data/set-hostname if it's empty (#1967)Emanuele Giuseppe Esposito2023-01-182-1/+18
| | | | | | | | | | | | | | | | If the file exists but is empty, do nothing. Otherwise cloud-init will crash because it does not handle the empty file. RHBZ: 2140893 Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
| * distros/rhel.py: _read_hostname() missing strip on "hostname" (#1941)Mark Mielke2023-01-182-0/+2
| | | | | | | | | | | | | | | | Debugging a related issue, I found that the determination of the "previous-hostname" was wrong on RHEL-based distributions. The fix is to add a call to strip on the result of the call to command "hostname" the same way the strip is done on the file containing the "previous-hostname".
| * integration tests: add IBM VPC support (SC-1352) (#1915)Alberto Contreras2023-01-185-1/+17
| |
| * machine-id: set to uninitialized to trigger regeneration on clonesChad Smith2023-01-173-10/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With systemd-networkd, the removal of /etc/machine-id can result in DHCP errors such as: DHCP4 CLIENT: Failed to set IAID+DUID: No such file or directory Adapt cloud-init clean --machine-id to be systemd-aware. systemd v. 237 and later will trigger /etc/machine-id regeneration on next boot when the value of /etc/machine-id file is 'uninitialized\n'. On systems without systemd, continue to remove /etc/machine-id when cloud-init clean --machine-id is provided as there are triggers in place to regenerate on absence of this file. LP: #1999680
| * sources/azure: retry on connection error when fetching metdata (#1968)Chris Patterson2023-01-172-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Early attempts to fetch metadata on Azure may fail with connection errors. While this class of errors is not ideal to retry on, the impact is minimal given that: 1. retries are fairly limited (10) 2. Persistent connection errors would indicate that cloud-init is using a non-primary NIC which is a rare case of failure that will be addressed in the future. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
| * Ensure ssh state accurately obtained (#1966)James Falcon2023-01-171-1/+1
| | | | | | Missed a .strip() in the implementation
| * bddeb: drop dh-systemd dependency on newer deb-based releasesd1r3ct0r2023-01-162-3/+4
| | | | | | | | | | | | Fix `make deb` and `make ubuntu-ci-deps` targets on Jammy and newer. Update packages/bddeb to only append dh-systemd as a dependency on older Debian and Ubuntu stable series.
| * doc: fix `config formats` link in cloudsigma.rst (#1960)Brett Holman2023-01-131-3/+2
| |
| * Fix wrong subp syntax in cc_set_passwords.py (#1961)James Falcon2023-01-133-3/+20
| | | | | | In #1909, I added a subp call with incorrect syntax. Fixing that here.
| * docs: update the PR template link to readthedocs (#1958)d1r3ct0r2023-01-131-1/+1
| |
| * ci: switch unittests to gh actions (#1956)Brett Holman2023-01-122-6/+34
| |
| * Add mount_default_fields for PhotonOS. (#1952)Shreenidhi Shedi2023-01-121-2/+4
| | | | | | | | | | Otherwise, this is results in some weird contention with systemd default service and cloud-init.service doesn't start at random intervals on Photon OS.
| * sources/azure: minor refactor for metadata source detection logic (#1936)Chris Patterson2023-01-121-29/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Initialize md and cfg to the fallback used when no OVF is found and IMDS is required. - Rename metadata_source -> ovf_source and drop usage of "IMDS" as a valid value. - Set `self.seed` to "IMDS" when ovf_source is unset. - Remove late check for metadata source. This is already done by the earlier check where we'll fail with "No OVF or IMDS available". - Move "Found provisioning metadata" diagnostic up to where we read OVF. Suggesting it was "IMDS" prior to querying IMDS is misleading. - Add warning when falling back to IMDS-only provisioning. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
| * add "CalvoM" as contributor (#1955)d1r3ct0r2023-01-121-0/+1
| |
| * ci: doc to gh actions (#1951)Brett Holman2023-01-122-11/+30
| | | | | | | | | | | | | | | | test: move doc test from Travis to Github actions Changes: - drop unnecessary setuptools pin - use current RTD Python version 3.10.8
| * lxd: handle 404 from missing devices route for LXD 4.0Chad Smith2023-01-112-5/+19
| | | | | | | | | | | | | | | | | | LXD 4.0 will not get a backport of the devices route on LXD socket API. This prevented launching Jammy from hosts with LXD 4.0. Allow cloud-init to support LXD backplanes without the "devices" route and use fallback network config when absent. LP: #2001737
| * docs: Diataxis overhaul (#1933)s-makin2023-01-10109-6836/+7425
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Diataxis overhaul and style review Introduces the Diataxis[1] framework including: - Created Diataxis folders - Moved all content to correct folders - Updated index page with Diataxis sections - Brought LHS nav bar into line with Diataxis - Brought all docs in line with Ubuntu style guide Additional minor/housekeeping changes: - Added anchor tags/updated others - Moved how-to content out of FAQ page (created new pages) - Decorated various elements with tags (see below) - Acronyms capitalised (and expanded on first showing if poss) - All headings now sentence case - Styling on all pages now self-consistent with each other - Some minor edits to language, mostly for clarity - Lists presented with headings in boldface changed to subheadings - (to make use of RHS navigation bar for user convenience) I also addressed inconsistencies in formatting and language. I'm aware that some of these changes may need to be reverted or changed to something else, so if I've made any errors in judgement through lack of knowledge, please lmk (or if there are overdue changes you want to make now while I'm doing it). I have decorated files/paths with the :file: rST tag, obvious commands with :command:, keyboard shortcuts with :kbd: and references to UI elements with :guilabel: - the default styling may not be ideal, but with the tags in place it can be edited en-masse through the style files so the text elements display as expected. There is an :abbr: tag that theoretically works like the hoverxref package, but the default styling makes it hard to read the text so I have not used it. There are similar tags for Python elements but I haven't used them either, due to unfamiliarity with the base code. [1] https://diataxis.fr/
| * vultr: Fix issue regarding cache and region codes (#1938)eb30952023-01-093-9/+20
| |
| * cc_set_passwords: Move ssh status checking later (SC-1368) (#1909)James Falcon2023-01-093-229/+58
| | | | | | | | | | | | | | If the service starts between checking status and writing config, then the new config will no longer be applied. Move the status checking later so the config is already written before we check if restart needed. LP: #1998526
| * Improve Wireguard module idempotency (#1940)Fabian Lichtenegger-Lukas2023-01-091-1/+1
| | | | | | | | | | When starting `wg-quick` service of an already configured system due to meta-data changed, changes in Wireguard config won't be loaded as the service already runs during cloud-init config section. Restart `wg-quick` systemd service to fix this behavior and improve idempotency.
| * network/netplan: add gateways as on-link when necessary (#1931)Louis Sautier2023-01-093-0/+62
| | | | | | | | | | | | | | | | network/netplan: add gateways as on-link when necessary When the gateway isn't part of the subnet's network, the "on-link" flag is required for the route to get added. LP: #2000596
| * tests: test_lxd assert features.networks.zones when present (#1939)Chad Smith2023-01-091-0/+4
| | | | | | | | | | LXD v 5.9 introduces a features.networks.zones default. Assert features.networks.zones when host provides this key. Cope with versions that do not surface this config.
| * Use btrfs enquque when available (#1926)Robert Schweikert2023-01-062-5/+37
| | | | | | | | | | | | | | | | | | | | | | | | btrfs has operations that are blocking and when we try to resize a btrfs filesystem we may be in a race condition with blocking operations. Use the enqueue feature introduced in btrfs 5.10 to queue our resize request until resize if possible. Before this commit, hitting this race would cause the command to immediately fail. With this change, the resize is queued and the command blocks until resize has completed (event driven, with a poll loop of 1m).
| * sources/azure: drop description for report_failure_to_fabric() (#1934)Chris Patterson2023-01-054-62/+14
| | | | | | | | | | | | | | | | | | The same default description is used for all error cases. Remove this parameter in favor of assuming the default in all cases. Future work will allow for error reporting with a customizable description using a different interface. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
| * cc_disk_setup.py: fix MBR single partition creation (#1932)dermotbradley2023-01-054-31/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the creation of single partitions on MBR devices. Currently this fails with the following debug output: cc_disk_setup.py[DEBUG]: Calculating partition layout cc_disk_setup.py[DEBUG]: Layout is: 0, cc_disk_setup.py[DEBUG]: Creating partition table on /dev/sdb subp.py[DEBUG]: Running command ['/sbin/sfdisk', '--Linux', '--unit=S', '--force', '/dev/sdb'] with allowed return codes [0] (shell=False, capture=True) util.py[DEBUG]: Creating partition on /dev/sdb took 0.237 seconds util.py[WARNING]: Failed partitioning operation Failed to partition device /dev/sdb Unexpected error while running command. Command: ['/sbin/sfdisk/', '--Linux', '--unit=S', '--force', '/dev/sdb'] Exit code: 1 Reason: - Stdout: Checking that no-one is using this disk right now ... OK Disk /dev/sdb: 16 MiB, 16777216 bytes, 32768 sectors Disk model: HARDDISK Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes >>> Created a new DOS disklabel with disk identifier 0xb3604c9a. /dev/sdb1: Leaving. Stderr: sfdisk: --Linux option is unnecessary and deprecated Start sector 0 out of range. Failed to add #1 partition: Result not representable util.py[DEBUG]: Failed partitioning operation On a BIOS/MBR partitioned device the 1st partition cannot start at sector 0 as this is reserved for the MBR. Documentation clarifications/corrections and additional examples added. Also remove "--Linux" and "--unit=S" options from sfdisk calls, these options have been deprecated since October 2014. Note: This is not a change of behavior because the change provoking the error was introduced in util-linux 2.26 in Xenial. Thus, every supported cloud-init version fails. LP: #1851438
| * Fix typo with package_update/package_upgrade (#1927)eb30952023-01-043-8/+8
| | | | | | | | | | | | | | test/doc: Fix typo with package_update/package_upgrade There's a typo in the docs that can lead to confusion. packages_update > package_update packages_upgrade > package_upgrade
| * sources/azure: fix device driver matching for net config (#1914)Chris Patterson2023-01-032-75/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The ordering of NICs provided by IMDS may not match the order enumerated by kernel. As such, we do not have any guarantee that the nic we're checking the driver for is the nic we think it is. Instead of making any assumptions about how the nics are named, check all interfaces by mac address. If there is an interface using "hv_netvsc", match against that. If there is only one interface driver that is not blacklisted, use that (in case it is not "hv_netvsc"), but log a debug event. If there are multiple hits, don't match against any of the names and report a warning. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
| * BSD: fix duplicate macs in Ifconfig parser (#1917)Mina Galić2023-01-034-14/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BSD: fix duplicate macs in Ifconfig parser Some cloud providers can have more than one device with the same MAC address. This PR allows parsing and storing and retrieving such configurations. We now use `defaultdict` to retrieve `ifs_by_mac`, before converting it all to a `dict`. We also store the two in separate variables. Add test case from Azure to verify, and test data in a new file, since our old cloudinit.net functions can't handle it. Sponsored by: FreeBSD Foundation
| * test: mock dns calls (#1922)Brett Holman2023-01-036-1/+36
| | | | | | | | | | Add fixture to disallow dns lookups by default in a common utility function.
| * pycloudlib: add lunar support for integration tests (#1928)Chad Smith2022-12-241-1/+1
| | | | | | Bump to fe7facd3
| * nocloud: add support for dmi variable expansion for seedfrom URLChad Smith2022-12-158-30/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NoCloud meta-data seedfrom (or kernel commandline seedfrom) URL can now provide variable expansion for system-specific DMI values as seen in /sys/class/dmi/id on Linux or kenv on FreeBSD platforms. Variable names of the format __dmi.SOME_VAR__ will be replaced when determining the URL from which NoCloud datasource GETs its user-data and meta-data. This allows for a common templated seedfrom URL which can be reused for mass deployments, but can allow for unique URLs based on classes of DMI system characteristics such as chassis serial, product name, UUID etc. LP: #1994980
| * tools: read-version drop extra call to git describe --longChad Smith2022-12-151-1/+0
| |
| * doc: improve cc_write_files doc (#1916)Alberto Contreras2022-12-151-3/+6
| |
| * read-version: When insufficient tags, use cloudinit.version.get_versionChad Smith2022-12-151-1/+10
| |
| * mounts: document weird prefix in schema (#1913)Brett Holman2022-12-153-3/+22
| | | | | | Add test and support for parsing IEC prefix format.
| * add utility function test cases (#1910)sxt10012022-12-142-0/+23
| | | | | | | | | | Add coverage for: - atomic_helper.write_file() - util.human2bytes()