Skip to content

Commit c6ec8fa

Browse files
committed
Add support for IONOS Cloud
1 parent 4a8f9be commit c6ec8fa

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ nav_order: 9
1313
- Support partitioning disk with mounted partitions
1414
- Support Proxmox VE
1515
- Support gzipped Akamai user_data
16+
- Support IONOS Cloud
1617

1718
### Changes
1819

docs/supported-platforms.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Ignition is currently supported for the following platforms:
2020
* [Hetzner Cloud] (`hetzner`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
2121
* [Microsoft Hyper-V] (`hyperv`) - Ignition will read its configuration from the `ignition.config` key in pool 0 of the Hyper-V Data Exchange Service (KVP). Values are limited to approximately 1 KiB of text, so Ignition can also read and concatenate multiple keys named `ignition.config.0`, `ignition.config.1`, and so on.
2222
* [IBM Cloud] (`ibmcloud`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
23+
* [IONOS Cloud] (`ionoscloud`) - Ignition will read its configuration from the instance userdata. Cloud SSH keys are handled separately.
2324
* [KubeVirt] (`kubevirt`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately.
2425
* Bare Metal (`metal`) - Use the `ignition.config.url` kernel parameter to provide a URL to the configuration. The URL can use the `http://`, `https://`, `tftp://`, `s3://`, `arn:`, or `gs://` schemes to specify a remote config.
2526
* [Nutanix] (`nutanix`) - Ignition will read its configuration from the instance userdata via config drive. Cloud SSH keys are handled separately.
@@ -52,6 +53,7 @@ For most cloud providers, cloud SSH keys and custom network configuration are ha
5253
[Hetzner Cloud]: https://www.hetzner.com/cloud
5354
[Microsoft Hyper-V]: https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/
5455
[IBM Cloud]: https://www.ibm.com/cloud/vpc
56+
[IONOS Cloud]: https://cloud.ionos.com/
5557
[KubeVirt]: https://kubevirt.io
5658
[Nutanix]: https://www.nutanix.com/products/ahv
5759
[OpenStack]: https://www.openstack.org/
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Copyright 2019 Red Hat, Inc.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// The IONOSCloud provider fetches configurations from the userdata available in
16+
// the injected file /var/lib/cloud/seed/nocloud/user-data.
17+
// NOTE: This provider is still EXPERIMENTAL.
18+
19+
package ionoscloud
20+
21+
import (
22+
"os"
23+
24+
"github.com/coreos/ignition/v2/config/v3_5_experimental/types"
25+
"github.com/coreos/ignition/v2/internal/platform"
26+
"github.com/coreos/ignition/v2/internal/providers/util"
27+
"github.com/coreos/ignition/v2/internal/resource"
28+
29+
"github.com/coreos/vcontext/report"
30+
)
31+
32+
const (
33+
defaultFilename = "/var/lib/cloud/seed/nocloud/user-data"
34+
)
35+
36+
func init() {
37+
platform.Register(platform.Provider{
38+
Name: "ionoscloud",
39+
Fetch: fetchConfig,
40+
})
41+
}
42+
43+
func fetchConfig(f *resource.Fetcher) (types.Config, report.Report, error) {
44+
f.Logger.Info("using config file at %q", defaultFilename)
45+
46+
rawConfig, err := os.ReadFile(defaultFilename)
47+
if err != nil {
48+
f.Logger.Err("couldn't read config %q: %v", defaultFilename, err)
49+
return types.Config{}, report.Report{}, err
50+
}
51+
return util.ParseConfig(f.Logger, rawConfig)
52+
}

internal/register/providers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
_ "github.com/coreos/ignition/v2/internal/providers/hetzner"
3030
_ "github.com/coreos/ignition/v2/internal/providers/hyperv"
3131
_ "github.com/coreos/ignition/v2/internal/providers/ibmcloud"
32+
_ "github.com/coreos/ignition/v2/internal/providers/ionoscloud"
3233
_ "github.com/coreos/ignition/v2/internal/providers/kubevirt"
3334
_ "github.com/coreos/ignition/v2/internal/providers/metal"
3435
_ "github.com/coreos/ignition/v2/internal/providers/nutanix"

0 commit comments

Comments
 (0)