Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

dracut: add hetzner cloud support #150

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions dracut/30ignition/coreos-static-hostname.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=CoreOS Static Hostname Agent
DefaultDependencies=false
Before=initrd.target
After=systemd-networkd.service initrd-root-fs.target
Wants=systemd-networkd.service initrd-root-fs.target

# Ensure Ignition can overwrite /etc/hostname
Before=ignition-files.service

[Service]
Type=oneshot
ExecStart=/usr/bin/coreos-metadata --cmdline --hostname=/sysroot/etc/hostname
3 changes: 3 additions & 0 deletions dracut/30ignition/ignition-generator
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ if $(cmdline_bool coreos.first_boot 0); then
if [[ $(cmdline_arg coreos.oem.id) == "packet" ]]; then
add_requires coreos-static-network.service
fi
if [[ $(cmdline_arg coreos.oem.id) == "hcloud" ]]; then
add_requires coreos-static-hostname.service
fi

# On EC2, shut down systemd-networkd if ignition fails so that the instance
# fails EC2 instance checks.
Expand Down
3 changes: 3 additions & 0 deletions dracut/30ignition/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ install() {
inst_simple "$moddir/coreos-digitalocean-network.service" \
"$systemdsystemunitdir/coreos-digitalocean-network.service"

inst_simple "$moddir/coreos-static-hostname.service" \
"$systemdsystemunitdir/coreos-static-hostname.service"

inst_simple "$moddir/coreos-static-network.service" \
"$systemdsystemunitdir/coreos-static-network.service"

Expand Down