diff --git a/README.md b/README.md index 38bc8a23..9b7d52eb 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,10 @@ information. It currently provides built-in configuration for Puppets' internal [vmpooler][vmpooler] hypervisor, [always-be-scheduling][always-be-scheduling] -hypervisor, static (non-provisioned) nodes, and is designed in a way that makes -it possible to easily add support for additional hypervisors -(any hypervisor type supported by [beaker][beaker]). +hypervisor, Vagrant with Virtualbox and Libvirt backend, +[Hetzner cloud](https://www.hetzner.com/cloud), static (non-provisioned) nodes, +and is designed in a way that makes it possible to easily add support for +additional hypervisors (any hypervisor type supported by [beaker][beaker]). To see the list of built-in hypervisors you can run: ``` diff --git a/lib/beaker-hostgenerator/data.rb b/lib/beaker-hostgenerator/data.rb index 28c9d2de..4169e976 100644 --- a/lib/beaker-hostgenerator/data.rb +++ b/lib/beaker-hostgenerator/data.rb @@ -116,6 +116,9 @@ def osinfo result["ubuntu#{release}04-64"] = { :general => { 'platform' => "ubuntu-#{release}.04-amd64" + }, + :hcloud => { + 'image' => "ubuntu-#{release}.04" } } @@ -291,6 +294,9 @@ def osinfo 'cp /bin/true /sbin/agetty', 'yum install -y crontabs initscripts iproute openssl sysvinit-tools tar wget which ss' ] + }, + :hcloud => { + 'image' => 'centos-7' } }, 'centos8-64' => { @@ -306,6 +312,9 @@ def osinfo 'cp /bin/true /sbin/agetty', 'yum install -y crontabs initscripts iproute openssl wget which glibc-langpack-en hostname' ] + }, + :hcloud => { + 'image' => 'centos-stream-8' } }, 'centos9-64' => { @@ -318,6 +327,9 @@ def osinfo 'cp /bin/true /sbin/agetty', 'dnf install -y crontabs initscripts iproute openssl wget which glibc-langpack-en' ] + }, + :hcloud => { + 'image' => 'centos-stream-9' } }, # Deprecated @@ -636,6 +648,9 @@ def osinfo }, :vmpooler => { 'template' => 'debian-10-x86_64' + }, + :hcloud => { + 'image' => 'debian-10' } }, 'debian10-32' => { @@ -669,6 +684,9 @@ def osinfo }, :vmpooler => { 'template' => 'debian-11-x86_64' + }, + :hcloud => { + 'image' => 'debian-11' } }, 'fedora14-32' => { @@ -1055,6 +1073,17 @@ def osinfo 'cp /bin/true /sbin/agetty', 'yum install -y crontabs initscripts iproute openssl wget which glibc-langpack-en' ] + }, + :hcloud => { + 'image' => 'rocky-8' + } + }, + 'rocky9-64' => { + :general => { + 'platform' => 'el-9-x86_64', + }, + :hcloud => { + 'image' => 'rocky-9' } }, 'scientific5-32' => { diff --git a/lib/beaker-hostgenerator/hypervisor.rb b/lib/beaker-hostgenerator/hypervisor.rb index ca795fba..25562620 100644 --- a/lib/beaker-hostgenerator/hypervisor.rb +++ b/lib/beaker-hostgenerator/hypervisor.rb @@ -45,7 +45,8 @@ def self.builtin_hypervisors() 'vagrant' => BeakerHostGenerator::Hypervisor::Vagrant, 'vagrant_libvirt' => BeakerHostGenerator::Hypervisor::Vagrant, 'docker' => BeakerHostGenerator::Hypervisor::Docker, - 'abs' => BeakerHostGenerator::Hypervisor::ABS + 'abs' => BeakerHostGenerator::Hypervisor::ABS, + 'hcloud' => BeakerHostGenerator::Hypervisor::Hcloud } end @@ -114,3 +115,4 @@ def base_generate_node(node_info, base_config, bhg_version, *hypervisors) require 'beaker-hostgenerator/hypervisor/vagrant' require 'beaker-hostgenerator/hypervisor/docker' require 'beaker-hostgenerator/hypervisor/abs' +require 'beaker-hostgenerator/hypervisor/hcloud' diff --git a/lib/beaker-hostgenerator/hypervisor/hcloud.rb b/lib/beaker-hostgenerator/hypervisor/hcloud.rb new file mode 100644 index 00000000..fdd6e970 --- /dev/null +++ b/lib/beaker-hostgenerator/hypervisor/hcloud.rb @@ -0,0 +1,16 @@ +require 'beaker-hostgenerator/data' +require 'beaker-hostgenerator/hypervisor' +require 'deep_merge/rails_compat' + +module BeakerHostGenerator + module Hypervisor + + class Hcloud < BeakerHostGenerator::Hypervisor::Interface + include BeakerHostGenerator::Data + + def generate_node(node_info, base_config, bhg_version) + return base_generate_node(node_info, base_config, bhg_version, :hcloud) + end + end + end +end