Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Simple Deploy- and Management
package.dhcp.kea
Commits
06ab33ca
Commit
06ab33ca
authored
May 10, 2019
by
Pietsch, Martin
Browse files
add rc.d files for kea DHCPv4, DHCPv6 and Control Agent
parent
da0cf6a9
Changes
5
Hide whitespace changes
Inline
Side-by-side
files/kea-ctrl-agent
0 → 100644
View file @
06ab33ca
#!/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
"
files/kea-dhcp4
0 → 100644
View file @
06ab33ca
#!/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
"
files/kea-dhcp6
0 → 100644
View file @
06ab33ca
#!/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
"
tasks/main.yml
View file @
06ab33ca
---
-
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
...
...
vars/main.yml
View file @
06ab33ca
...
...
@@ -4,6 +4,6 @@ package_packages: {
}
package_services
:
{
"
freebsd"
:
[
"
kea"
]
"
freebsd"
:
[
"
kea
-dhcp4"
,
"
kea-dhcp6
"
]
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment