hwdb: add Oracle Cloud OCI IMDS data#4
Closed
rpigott wants to merge 18 commits intopoettering:imdsfrom
Closed
Conversation
Credentials are highly privileged things, but still, let's do some validation, because we can.
For the IMDS case there's value in being able to set the static hostname, instead of just the transient one. Let's introduce firstboot.hostname, which only applies to first boot, and write the static hostname. This is different from system.hostname which applies to any boot, and writes the transient hostname.
This stuff needs assert() defined, but we don't really want to pull in assert-fundamental.h into macro.h just for this, hence split this out.
This is very similar to write_string_file_atomic(), but is intentionally kept separate (after long consideration). It focusses on arbitrary struct iovec data, not just strings, and hence also doesn't do stdio at all. It's hence a lot more low-level. We might want to consider moving write_string_file*() on top of write_data_file_atomic_at(), but for now don't.
…ter it For various usecases it is useful to read relevant data from the DMI udev device, but this means we need a way to wait for it for this to be probed to be race-free. Hence tag it with "systemd", so that sys-devices-virtual-dmi-id.device can be used as synchronization point.
This only parses a small subset of RR types for now, but we can add more later. Covered are the most important RR types: A, AAAA, PTR.
let's ensure the name is actually a valid DNS name.
When we are told to reload our configuration also flush out /etc/hosts explicitly. This is particularly relevant since we suppress too frequent reloads, and hence a synchronous way to force a reload is very useful.
This is an extension of the /etc/hosts concept, but can provide any kind of RRs (well, actually, we only parse A/AAAA/PTR for now, but the concept is open for more). Fixes: systemd#17791
e7ccdfa to
9922f5e
Compare
Author
|
This is now included in the main PR. Closing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for Oracle Cloud "OCI".
I don't think public IPv4 data is available via IMDS, but IPv6 GUA is available under the /vnics path. A host in OCI can have multiple vnics, I believe each potentially with multiple GUA, not sure how this should be handled in systemd-imds, so I've chosen to omit the IPv4/IPv6 public addr keys.
Oracle has multiple cloud services. This IMDS service matches what is available in OCI, in contrast with their other cloud services like PCA. As recorded in the comment, the documentation for the OCI IMDS keys is available here. This PR uses the IMDSv2 keys.