Commit 06ab33ca authored by Pietsch, Martin's avatar Pietsch, Martin

add rc.d files for kea DHCPv4, DHCPv6 and Control Agent

parent da0cf6a9
#!/bin/sh
#
# PROVIDE: kea-ctrl-agent
# REQUIRE: netif routing
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# kea_ctrl_agent_enable="YES"
#
. /etc/rc.subr
name="kea_ctrl_agent"
rcvar="${name}_enable"
command="/usr/local/sbin/keactrl"
extra_commands="reload"
start_cmd="kea_cmd start"
stop_cmd="kea_cmd stop"
status_cmd="kea_status_cmd"
reload_cmd="kea_cmd reload"
kea_status_cmd()
{
state=$($command status | grep "^Control Agent" | cut -f 3 -d " ")
echo "Kea Control Agent is ${state}"
if [ ${state} == "active" ]; then
return 0
else
return 1
fi
}
kea_cmd()
{
$command $1 -s ctrl_agent
}
load_rc_config $name
run_rc_command "$1"
#!/bin/sh
#
# PROVIDE: kea-dhcp4
# REQUIRE: netif routing
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# kea_dhcp4_enable="YES"
#
. /etc/rc.subr
name="kea_dhcp4"
rcvar="${name}_enable"
command="/usr/local/sbin/keactrl"
extra_commands="reload"
start_cmd="kea_cmd start"
stop_cmd="kea_cmd stop"
status_cmd="kea_status_cmd"
reload_cmd="kea_cmd reload"
kea_status_cmd()
{
state=$($command status | grep "^DHCPv4 server" | cut -f 3 -d " ")
echo "Kea DHCPv4 server is ${state}"
if [ ${state} == "active" ]; then
return 0
else
return 1
fi
}
kea_cmd()
{
$command $1 -s dhcp4
}
load_rc_config $name
run_rc_command "$1"
#!/bin/sh
#
# PROVIDE: kea-dhcp6
# REQUIRE: netif routing
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# kea_dhcp6_enable="YES"
#
. /etc/rc.subr
name="kea_dhcp6"
rcvar="${name}_enable"
command="/usr/local/sbin/keactrl"
extra_commands="reload"
start_cmd="kea_cmd start"
stop_cmd="kea_cmd stop"
status_cmd="kea_status_cmd"
reload_cmd="kea_cmd reload"
kea_status_cmd()
{
state=$($command status | grep "^DHCPv6 server" | cut -f 3 -d " ")
echo "Kea DHCPv6 server is ${status}"
if [ ${state} == "active" ]; then
return 0
else
return 1
fi
}
kea_cmd()
{
$command $1 -s dhcp6
}
load_rc_config $name
run_rc_command "$1"
---
- name: install rc.d files
copy:
src: "{{ _rcfile }}"
dest: "{{ system_config_directory }}/rc.d/{{ _rcfile }}"
loop:
- "kea-ctrl-agent"
- "kea-dhcp4"
- "kea-dhcp6"
loop_control:
loop_var: _rcfile
- name: set permissions of rc.d files
file:
path: "{{ system_config_directory }}/rc.d/{{ _rcfile }}"
mode: '555'
loop:
- "kea-ctrl-agent"
- "kea-dhcp4"
- "kea-dhcp6"
loop_control:
loop_var: _rcfile
- include_role:
name: package.dhcp
......
......@@ -4,6 +4,6 @@ package_packages: {
}
package_services: {
"freebsd": ["kea"]
"freebsd": ["kea-dhcp4", "kea-dhcp6"]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment