From 49adf190810f8ff757e427bbeb486a7bdd358d73 Mon Sep 17 00:00:00 2001 From: Brian Waldon Date: Tue, 22 Apr 2014 16:56:14 -0700 Subject: [PATCH] feat(proc-cmdline): Add proc-cmdline unit This unit will always be started, but will only do anything if a `cloud-config-url=` token is provided in /proc/cmdline. --- units/user-cloudinit-proc-cmdline.service | 12 ++++++++++++ units/user-config.target | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 units/user-cloudinit-proc-cmdline.service diff --git a/units/user-cloudinit-proc-cmdline.service b/units/user-cloudinit-proc-cmdline.service new file mode 100644 index 0000000..72ef568 --- /dev/null +++ b/units/user-cloudinit-proc-cmdline.service @@ -0,0 +1,12 @@ +[Unit] +Description=Load cloud-config from url defined in /proc/cmdline +Requires=coreos-setup-environment.service +After=coreos-setup-environment.service +Before=user-config.target +ConditionKernelCommandLine=cloud-config-url + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=-/etc/environment +ExecStart=/usr/bin/coreos-cloudinit --from-proc-cmdline diff --git a/units/user-config.target b/units/user-config.target index 4f86d4b..018b47d 100644 --- a/units/user-config.target +++ b/units/user-config.target @@ -6,3 +6,6 @@ After=system-config.target # Load user_data placed by coreos-install Requires=user-cloudinit@var-lib-coreos\x2dinstall-user_data.service After=user-cloudinit@var-lib-coreos\x2dinstall-user_data.service + +Requires=user-cloudinit-proc-cmdline.service +After=user-cloudinit-proc-cmdline.service