Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/supported-platforms.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Ignition is currently only supported for the following platforms:
* [Packet] - Ignition will read its configuration from the instance userdata. SSH keys are handled by coreos-metadata.
* [QEMU] - Ignition will read its configuration from the 'opt/com.coreos/config' key on the QEMU Firmware Configuration Device.
* [DigitalOcean] - Ignition will read its configuration from the droplet userdata. SSH keys and network configuration are handled by coreos-metadata.
* [Hetzner Cloud] - Ignition will read its configuration from the instance userdata. SSH keys are handled by coreos-metadata.

Ignition is under active development so expect this list to expand in the coming months.

Expand Down
5 changes: 5 additions & 0 deletions internal/oem/oem.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/coreos/ignition/internal/providers/ec2"
"github.com/coreos/ignition/internal/providers/file"
"github.com/coreos/ignition/internal/providers/gce"
"github.com/coreos/ignition/internal/providers/hcloud"
"github.com/coreos/ignition/internal/providers/noop"
"github.com/coreos/ignition/internal/providers/openstack"
"github.com/coreos/ignition/internal/providers/packet"
Expand Down Expand Up @@ -110,6 +111,10 @@ func init() {
name: "gce",
fetch: gce.FetchConfig,
})
configs.Register(Config{
name: "hcloud",
fetch: hcloud.FetchConfig,
})
configs.Register(Config{
name: "hyperv",
fetch: noop.FetchConfig,
Expand Down
46 changes: 46 additions & 0 deletions internal/providers/hcloud/hcloud.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2018 CoreOS, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// The hcloud provider fetches a remote configuration from the Hetzner Cloud user-data
// metadata service URL.

package hcloud

import (
"net/url"

"github.com/coreos/ignition/config/validate/report"
"github.com/coreos/ignition/internal/config/types"
"github.com/coreos/ignition/internal/providers/util"
"github.com/coreos/ignition/internal/resource"
)

var (
userdataUrl = url.URL{
Scheme: "http",
Host: "169.254.169.254",
Path: "2009-04-04/user-data",
}
)

func FetchConfig(f resource.Fetcher) (types.Config, report.Report, error) {
data, err := f.FetchToBuffer(userdataUrl, resource.FetchOptions{
Headers: resource.ConfigHeaders,
})
if err != nil {
return types.Config{}, report.Report{}, err
}

return util.ParseConfig(f.Logger, data)
}