platform/api/packet: Don't validate cloud-configs
coreos-install was detecting invalid cloud-configs and refusing to run.
@@ -277,6 +277,8 @@ After=dev-sda.device
[Service]
Type=oneshot
+# Prevent coreos-install from validating cloud-config
+Environment=PATH=/root/bin:/usr/sbin:/usr/bin
ExecStart=/usr/bin/coreos-install -b "%v" -V "%v" -d /dev/sda -o packet %v /userdata
@@ -293,6 +295,9 @@ StandardError=journal+console
RequiredBy=multi-user.target
`, a.opts.ImageBaseURL, a.opts.ImageVersion, userDataOption, linuxConsole[a.opts.Board])
+ // make workarounds
+ coreosCloudInit := base64.StdEncoding.EncodeToString([]byte("#!/bin/sh\nexit 0"))
+
// make Ignition config
b64UserData := base64.StdEncoding.EncodeToString([]byte(userdata))
var buf bytes.Buffer
@@ -312,6 +317,17 @@ RequiredBy=multi-user.target
},
},
},
+ ignition.File{
+ Filesystem: "root",
+ Path: "/root/bin/coreos-cloudinit",
+ Contents: ignition.FileContents{
+ Source: ignition.Url{
+ Scheme: "data",
+ Opaque: ";base64," + coreosCloudInit,
+ },
+ },
+ Mode: 0755,
+ },
},
},
Systemd: ignition.Systemd{
