#!/sbin/openrc-run

description="cloud-init config stage"

depend() {
  after cloud-init-local
  after cloud-init
  before cloud-final
  provide cloud-config
}

start() {
  if grep -q 'cloud-init=disabled' /proc/cmdline; then
    ewarn "$RC_SVCNAME is disabled via /proc/cmdline."
  elif test -e /etc/cloud/cloud-init.disabled; then
    ewarn "$RC_SVCNAME is disabled via cloud-init.disabled file"
  else
    ebegin "cloud-init config"
    cloud-init modules --mode config
    eend $?
  fi
}
