-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add equinix support #56
Merged
Merged
Conversation
This file contains 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
bwarden
force-pushed
the
add-equinix-support
branch
from
October 14, 2022 17:58
a4dffbc
to
c5a293a
Compare
@ahkok mind reviewing? |
ahkok
reviewed
Oct 14, 2022
ahkok
reviewed
Oct 14, 2022
ahkok
reviewed
Oct 14, 2022
ahkok
reviewed
Oct 14, 2022
ahkok
reviewed
Oct 14, 2022
ahkok
reviewed
Oct 14, 2022
bwarden
force-pushed
the
add-equinix-support
branch
2 times, most recently
from
October 14, 2022 18:42
b51796b
to
85f6755
Compare
ahkok
reviewed
Oct 14, 2022
bwarden
force-pushed
the
add-equinix-support
branch
4 times, most recently
from
October 14, 2022 21:57
5d50b21
to
808d95c
Compare
I finally figured out how to get the fetch_test and fetch_data contents into the dist tarball. |
This looks mostly ready now. |
ahkok
approved these changes
Oct 21, 2022
The data fetcher tool operated assuming the key file presented on the server contains only 1 key. However, several cloud providers use this file to present multiple keys to the client systems at provisioning time and this should be functional. Without this change, only the first key will be properly inserted into yaml, and all secondary keys will result in a yaml failure or be ignored entirely. It would look something like this: ``` ssh_authorized_keys: - ssh-rsa <correct key 1> ssh-rsa <this key 2 will be ignored> ssh-rsa <this key 3 will be ignored> ``` The template is modified to allow line-by-line reading of the key file from the server, and each line written will be prefixed with the yaml " - " entry prefix in the output file. When writing the SSH keys to our generated cloud-config file, make sure to follow with an extra line feed before we concatenate the user-data contents. Otherwise, we could end up including the first line of the user-data response in the authorized_keys file, e.g. ssh-rsa <...key...> user@host#cloud-config ^^^^^^^^^^^^^ Instead, worst case, /var/lib/cloud/<provider>-user-data might just have an extra (ignored) blank line.
Instead of creating a unique service file for each provider, just use a single instance service. We'll change the symlinks in packaging.
Some servers require the host name to be sent in the user-data API request. We can allow a host name instead of IP address in the config struct by doing a lookup if it's not an IP address already.
To provision on equinix we can grab the `keys` file from their service. The address I entered in the template is tentative - it needs to be checked that metadata.platformequinix.com resolves to that address in their internal network as well that it's on a static IP address and not some RR load balancer service - ideally.
Don't close the socket until we're done reading. Make sure the socket fd/stream gets closed in all the error paths preceding our close/fclose. Also ensure the output file is closed properly in error cases.
Additional URI https://metadata.platformequinix.com/userdata Also add missing users key in generated equinix conf Our output for the equinix cloud config file omitted the "users:" key prior to defining the user.
To improve package test capabilities, introduce a test target that will attempt to fetch SSH keys and user data from a locally-spawned test server. Add other bits in ucd-data-fetch.c to support testing. Add fetch_test, which spawns an HTTP server to serve some sample user-data and cloud-config files, and verify that ucd-data-fetch can retrieve them.
In case networking takes as long as a minute to come up, give hostname lookup up to 100 seconds to complete. Give initial HTTP request up to 120 seconds _from when we started_ to succeed, so even if we spent all our time waiting on DNS, we still give 20 more seconds for the HTTP server.
bwarden
force-pushed
the
add-equinix-support
branch
from
October 21, 2022 17:39
affc58c
to
95ee67a
Compare
ahkok
approved these changes
Oct 21, 2022
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.
No description provided.