feat(coreos-base/coreos-cloudinit): Create generic template.

Replace coreos-cloudinit-oem.service by a generic service template that
can be used for any path. Add rule to load cloud-configs installed by
the coreos-install utility.
This commit is contained in:
Michael Marineau 2014-03-28 15:03:37 -07:00
parent 66d877f32d
commit 1b8331db60
5 changed files with 19 additions and 18 deletions

View File

@ -36,8 +36,7 @@ src_compile() {
src_install() {
dobin ${S}/bin/coreos-cloudinit
systemd_dounit "${FILESDIR}"/coreos-cloudinit-oem.service
systemd_dounit "${FILESDIR}"/coreos-cloudinit@.service
systemd_dounit "${FILESDIR}"/cloud-config.target
systemd_enable_service default.target coreos-cloudinit-oem.service
systemd_enable_service default.target cloud-config.target
}

View File

@ -1,6 +1,9 @@
[Unit]
Requires=coreos-cloudinit-oem.service
After=coreos-cloudinit-oem.service
# Load OEM and coreos-install cloud-configs by default
Requires=coreos-cloudinit@usr-share-oem-cloud\x2dconfig.yml.service
After=coreos-cloudinit@usr-share-oem-cloud\x2dconfig.yml.service
Requires=coreos-cloudinit@var-lib-coreos\x2dinstall-user_data.service
After=coreos-cloudinit@var-lib-coreos\x2dinstall-user_data.service
[Install]
WantedBy=multi-user.target

View File

@ -1,14 +0,0 @@
[Unit]
Description=coreos-cloudinit for /usr/share/oem/cloud-config.yml
Requires=dbus.service
After=dbus.service
RequiresMountsFor=/usr/share/oem
ConditionPathExists=/usr/share/oem/cloud-config.yml
[Service]
Type=oneshot
ExecStart=/usr/bin/coreos-cloudinit --from-file=/usr/share/oem/cloud-config.yml
[Install]
WantedBy=multi-user.target
WantedBy=cloudinit.target

View File

@ -0,0 +1,13 @@
[Unit]
Description=Load cloud-config from %f
Requires=dbus.service
After=dbus.service
RequiresMountsFor=%f
ConditionFileNotEmpty=%f
[Service]
Type=oneshot
ExecStart=/usr/bin/coreos-cloudinit --from-file=%f
[Install]
WantedBy=cloud-config.target