-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from flatcar-linux/tormath1/ignition3
systemd/system: add oem cloud init service
- Loading branch information
Showing
3 changed files
with
25 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,13 @@ | ||
[Unit] | ||
Description=Enable cloudinit | ||
|
||
[Service] | ||
Type=oneshot | ||
StandardInput=file:/etc/.ignition-result.json | ||
ExecCondition=/usr/bin/jq -e '.userConfigProvided == false' | ||
ExecCondition=/usr/bin/jq -e '.provisioningBootID | gsub(\"-\"; \"\") | . == $id' --arg id %b | ||
ExecStart=/usr/bin/systemctl enable --now oem-cloudinit.service | ||
RemainAfterExit=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
1 change: 1 addition & 0 deletions
1
systemd/system/multi-user.target.wants/enable-oem-cloudinit.service
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 @@ | ||
../enable-oem-cloudinit.service |
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,11 @@ | ||
[Unit] | ||
Description=Run cloudinit | ||
|
||
[Service] | ||
EnvironmentFile=/var/run/ignition.env | ||
Type=oneshot | ||
ExecCondition=/usr/bin/bash -xc 'OEMS=(aws gce rackspace-onmetal azure cloudsigma packet vmware digitalocean); echo $${OEMS[*]} | tr " " "\n" | grep -q -x -F "${OEM_ID}"' | ||
ExecStart=/usr/bin/bash -xc '/usr/bin/coreos-cloudinit --oem="$(if [ "${OEM_ID}" = aws ]; then echo ec2-compat; else echo "${OEM_ID}" ; fi)"' | ||
|
||
[Install] | ||
WantedBy=multi-user.target |