Templatize host-failure-reboots service

This service touches a host0 setting, so it
needs to be a template and touch host%i.

Change-Id: I9cf84ec40f5fe3aa1ad2c420aaa26d522eece6e1
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service b/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service
new file mode 100644
index 0000000..67a9aff
--- /dev/null
+++ b/common/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Enable reboot on host failures
+Wants=mapper-wait@-org-openbmc-settings-host%i.service
+After=mapper-wait@-org-openbmc-settings-host%i.service
+
+[Service]
+ExecStart = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host%i` /org/openbmc/settings/host%i org.openbmc.settings.Host auto_reboot s \"yes\""
+ExecStop = /bin/sh -c "busctl set-property `mapper get-service /org/openbmc/settings/host%i` /org/openbmc/settings/host%i org.openbmc.settings.Host auto_reboot s \"no\""
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}