# platform = multi_platform_all
# reboot = false
# strategy = enable
# complexity = low
# disruption = low
{{%- if init_system == "systemd" %}}

{{{ bash_instantiate_variables(VARIABLE) }}}

SYSTEMCTL_EXEC='/usr/bin/systemctl'
{{% if OPERATION == "pattern match" %}}
if [[ "{{{ VALUE }}}" =~ ${{{ VARIABLE }}} ]]; then
{{% else %}}
if [ ${{{ VARIABLE }}} == {{{ VALUE }}} ]; then
{{%- endif %}}
  "$SYSTEMCTL_EXEC" unmask '{{{ DAEMONNAME }}}.service'
  "$SYSTEMCTL_EXEC" start '{{{ DAEMONNAME }}}.service'
  "$SYSTEMCTL_EXEC" enable '{{{ DAEMONNAME }}}.service'
fi
{{% else %}}
JINJA TEMPLATE ERROR: Unknown init system '{{{ init_system }}}'
{{%- endif %}}
