-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dracut module to run afterburn in the initramfs, and add an initial service to fetch hostname on necessary providers (Azure). Signed-off-by: Yu Qi Zhang <jerzhang@redhat.com>
- Loading branch information
1 parent
4b12bfd
commit c4c4099
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[Unit] | ||
Description=Afterburn Hostname | ||
# Azure needs to fetch the hostname in the initramfs | ||
ConditionKernelCommandLine=|ignition.platform.id=azure | ||
|
||
# This will be firstboot only to set up the correct | ||
# hostname for kube. | ||
ConditionFirstBoot=yes | ||
|
||
# We order this service after disks have been provisioned | ||
# but before ignition-files stage has run, so ignition can | ||
# overwrite the configured hostname with e.g. a static one | ||
After=ignition-disks.service | ||
Before=ignition-files.service | ||
|
||
OnFailure=emergency.target | ||
OnFailureJobMode=isolate | ||
|
||
[Service] | ||
ExecStart=/usr/bin/afterburn --cmdline --hostname=/sysroot/etc/hostname | ||
Type=oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- | ||
# ex: ts=8 sw=4 sts=4 et filetype=sh | ||
|
||
check() { | ||
return 0 | ||
} | ||
|
||
depends() { | ||
echo systemd network | ||
} | ||
|
||
install() { | ||
inst_multiple afterburn | ||
|
||
inst_simple "$moddir/afterburn-hostname.service" \ | ||
"$systemdutildir/system/afterburn-hostname.service" | ||
|
||
mkdir -p "$initdir/$systemdsystemunitdir/initrd.target.requires" | ||
|
||
ln -s "../afterburn-hostname.service" "$initdir/$systemdsystemunitdir/initrd.target.requires/afterburn-hostname.service" | ||
} |