| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| | |
- Add stronger warnings for resolv_conf module.
- Add link to lxd network config docs.
|
| |
| |
| |
| |
| | |
Drop httpretty from list of ignored modules to type-check.
This module was dropped in favor of responses.
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Fix test_lp1912844.py where the intance's ip was not
correctly detected in pycloudlib
|
| |
| |
| | |
Bionic will no longer be supported by version in pip
|
| |
| |
| |
| |
| | |
Newer SUSE distributions are switching to NetworkManager from wicked.
For those distributions we need to wait for NetworkManager before
starting the cloud-init service.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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).
|
| |
| |
| |
| |
| |
| | |
::/0 would get rendered as ::/64 rather than ::/0 across all renderers
using ipv6 in a v2 config.
LP: #2003562
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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".
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| | |
Missed a .strip() in the implementation
|
| |
| |
| |
| |
| |
| | |
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.
|
| | |
|
| |
| |
| | |
In #1909, I added a subp call with incorrect syntax. Fixing that here.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- 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>
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
test: move doc test from Travis to Github actions
Changes:
- drop unnecessary setuptools pin
- use current RTD Python version 3.10.8
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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/
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
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
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
|
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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).
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
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
|
| |
| |
| |
| |
| | |
Add fixture to disallow dns lookups by
default in a common utility function.
|
| |
| |
| | |
Bump to fe7facd3
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
|
| | |
|
| | |
|
| |
| |
| | |
Add test and support for parsing IEC prefix format.
|
| |
| |
| |
| |
| | |
Add coverage for:
- atomic_helper.write_file()
- util.human2bytes()
|