## template:jinja
#!/bin/sh

# PROVIDE: cloudconfig
# REQUIRE: cloudinit
# BEFORE: sshd

$_rc_subr_loaded . /etc/rc.subr

name="cloudinit"
start_cmd="start_cloud_init"
start_cloud_init()
{
    if test -e {{prefix}}/etc/cloud/cloud-init.disabled ; then
       warn "cloud-init disabled by cloud-init.disabled file"
       exit 0
    fi
    {{prefix}}/bin/cloud-init modules --mode config
}

load_rc_config $name
run_rc_command "$1"
