1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
# 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 %}}
|