-
Notifications
You must be signed in to change notification settings - Fork 13
/
user-configdrive.service
29 lines (27 loc) · 1.48 KB
/
user-configdrive.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[Unit]
Description=Load cloud-config from /media/configdrive
Requires=flatcar-setup-environment.service
After=flatcar-setup-environment.service system-config.target
Before=user-config.target
# HACK: work around ordering between config drive and ec2 metadata It is
# possible for OpenStack style systems to provide both the metadata service
# and config drive, to prevent the two from stomping on each other, force
# this to run after OEM and after metadata (if it exsts). I'm doing this
# here instead of in the oem service because the oem unit is not written
# to disk until the OEM cloud config is evaluated and I want to make sure
# systemd knows about the ordering as early as possible.
# coreos-cloudinit could implement a simple lock but that cannot be used
# until after the systemd dbus calls are made non-blocking.
After=enable-oem-cloudinit.service oem-cloudinit.service
# Skip on clouds that are covered by flatcar/init:systemd/system/oem-cloudinit.service
ConditionKernelCommandLine=!flatcar.oem.id=digitalocean
ConditionKernelCommandLine=!coreos.oem.id=digitalocean
ConditionKernelCommandLine=!coreos.oem.id=openstack
ConditionKernelCommandLine=!flatcar.oem.id=openstack
[Service]
Type=oneshot
ExecCondition=/usr/bin/bash -c "if [ -f '/etc/.ignition-result.json' ] && /usr/bin/jq -e '.userConfigProvided == true' /etc/.ignition-result.json; then exit 1; fi"
TimeoutSec=10min
RemainAfterExit=yes
EnvironmentFile=-/etc/environment
ExecStart=/usr/bin/coreos-cloudinit --from-configdrive=/media/configdrive