summaryrefslogtreecommitdiff
path: root/sysvinit/freebsd/cloudconfig
diff options
context:
space:
mode:
Diffstat (limited to 'sysvinit/freebsd/cloudconfig')
-rwxr-xr-xsysvinit/freebsd/cloudconfig34
1 files changed, 34 insertions, 0 deletions
diff --git a/sysvinit/freebsd/cloudconfig b/sysvinit/freebsd/cloudconfig
new file mode 100755
index 00000000..978c32b8
--- /dev/null
+++ b/sysvinit/freebsd/cloudconfig
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+# PROVIDE: cloudconfig
+# REQUIRE: cloudinit cloudinitlocal
+# BEFORE: cloudfinal
+
+. /etc/rc.subr
+
+name="cloudconfig"
+command="/usr/bin/cloud-init"
+start_cmd="cloudconfig_start"
+stop_cmd=":"
+rcvar="cloudinit_enable"
+start_precmd="cloudinit_override"
+start_cmd="cloudconfig_start"
+
+: ${cloudinit_config}:="/etc/cloud/cloud.cfg"}
+
+
+cloudinit_override()
+{
+ # If there exist sysconfig/default variable override files use it...
+ if [ -f /etc/default/cloud-init ]; then
+ . /etc/default/cloud-init
+ fi
+}
+
+cloudconfig_start() {
+ echo "${command} starting"
+ ${command} ${cloudinit_config} modules --mode config
+}
+
+load_rc_config $name
+run_rc_command "$1"