forked from openshift/okd-machine-os
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcp-hostname.service
21 lines (21 loc) · 834 Bytes
/
gcp-hostname.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[Unit]
Description=Set GCP Transient Hostname
# Run for GCP only
ConditionKernelCommandLine=|ignition.platform.id=gce
ConditionKernelCommandLine=|ignition.platform.id=gcp
# Removal of this file signals firstboot completion
ConditionPathExists=!/etc/ignition-machine-config-encapsulated.json
# Block services relying on Networking being up.
Before=network-online.target
# Wait for NetworkManager to report its online
After=NetworkManager-wait-online.service
# Run before hostname checks
Before=node-valid-hostname.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/afterburn --provider gcp --hostname=/run/afterburn.hostname
ExecStart=/bin/bash -c "source /usr/local/sbin/set-valid-hostname.sh; set_valid_hostname `cat /run/afterburn.hostname`"
[Install]
WantedBy=multi-user.target
WantedBy=network-online.target