-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Initial implementation of hypervisor #10 #11
Conversation
Offers limited options to customize server creation (choosing an image, server type and location by name). SSH keys are being generated on-the-fly building on the `ssh_data` gem.
Codecov ReportBase: 0.00% // Head: 92.30% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #11 +/- ##
===========================================
+ Coverage 0.00% 92.30% +92.30%
===========================================
Files 2 3 +1
Lines 26 78 +52
===========================================
+ Hits 0 72 +72
+ Misses 26 6 -20
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
README.md
Outdated
You need to create an API token using Hetzner's cloud console. Make | ||
sure to create the token in the correct project. | ||
|
||
`beaker-hcloud` expects the token to be in the `HCLOUD_TOKEN` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl when we introduce a new environment variable, do we want it prefixed with BEAKER_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, but I finally got around to renaming the environment variable.
s.add_runtime_dependency 'hcloud', '>= 1.0.3', '< 2.0.0' | ||
s.add_runtime_dependency 'ssh_data', '~> 1.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a bit dissapointing that the ed25519 isn't sufficient here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the ed25519
gem is only about the algorithm itself. It knows nothing about SSH. The (to me) disappointing bit was that no existing gem seems to support the key generation / serialization of ed25519 keys. net-ssh
does not include key generation at all. There is a gem called sshkey
which would be perfect but only supports RSA/DSA (with partial support for reading ed25519 keys).
ssh_data
was the closest thing I could find for what we need, but it still lacked the serialization of the private key.
Sorry for the slow response here, I was busy with other stuff :(.I gave this a try in our puppet-hdm module: This fails because our github action doesn't support a custom image option (yet). This results in the following error:
When I pass the image attribute it works and creates a VM:
|
Edit: When I don't mix ubuntu 18 and 20 it's actually working:
Edit 2: I did some try and error and updated beaker-hostgenerator: voxpupuli/beaker-hostgenerator#261 |
puppet_metadata adds an attribute to each host, with the desired hostname: https://github.com/voxpupuli/puppet_metadata/blob/master/lib/puppet_metadata/beaker.rb#L51
configure the hostname with the desired hostname
The rubocop action is now failing. Sadly, I cannot reproduce this locally. Also the error message given does not indicate where the problem occurs 🤷♂️ |
@oneiros check https://github.com/voxpupuli/beaker-hcloud/pull/11/files. rubocop does annotations and complains in line 93 in file spec/beaker/hypervisor/hcloud_spec.rb. Does that help? |
@bastelfreak Thank you so much. That helped! I fixed the problem and rubocop immediately found more ones 🙄 But this finally led me to understand why I could not observe this locally: Since OTOH, this way you always get up-to-date feedback on every CI run. |
yes, we need to figure out which rubocop version (and ruby version) we want to use. All other beaker gems suppory Ruby 2.4/2.5 and newer, but we plan to update this in the next weeks. Do you have any idea why Ruby 2.7 fails in CI? |
Not to the point that I can fully explain it, no 😅 But I pushed a fix that seems to work. |
Offers limited options to customize server creation (choosing an image, server type and location by name).
SSH keys are being generated on-the-fly building on the
ssh_data
gem.See #10 for details.