Skip to content

Commit

Permalink
Merge pull request #138 from ansibleguy/dhcp-kea-service
Browse files Browse the repository at this point in the history
add kea-dhcp to service and reload modules (fix #137)
  • Loading branch information
ansibleguy authored Jan 7, 2025
2 parents 4507e99 + 9d63be3 commit 9a52237
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/modules/2_reload.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Definition
:header: "Parameter", "Type", "Required", "Default", "Aliases", "Comment"
:widths: 15 10 10 10 10 45

"target","string","true","\-","tgt, t","What part of the running config should be reloaded. One of: 'alias', 'rule', 'route', 'cron', 'unbound', 'syslog', 'ipsec', 'ipsec_legacy', 'shaper', 'monit', 'wireguard', 'interface_vlan', 'interface_vxlan', 'interface_vip', 'interface_lagg', 'frr', 'webproxy', 'bind', 'ids', 'dhcrelay'"
"target","string","true","\-","tgt, t","What part of the running config should be reloaded. One of: 'alias', 'rule', 'route', 'cron', 'unbound', 'syslog', 'ipsec', 'ipsec_legacy', 'shaper', 'monit', 'wireguard', 'interface_vlan', 'interface_vxlan', 'interface_vip', 'interface_lagg', 'frr', 'webproxy', 'bind', 'ids', 'dhcrelay', 'dhcp', 'kea'"

.. include:: ../_include/param_basic.rst

Expand Down
2 changes: 1 addition & 1 deletion docs/source/modules/service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Definition
:header: "Parameter", "Type", "Required", "Default", "Aliases", "Comment"
:widths: 15 10 10 10 10 45

"name","string","true","\-","service, target, svc, n","Pretty name of the service to interact with. One of: 'acme_client', 'apcupsd', 'bind', 'captive_portal', 'chrony', 'cicap', 'clamav', 'collectd', 'cron', 'crowdsec', 'dns_crypt_proxy', 'dyndns', 'fetchmail', 'freeradius', 'frr', 'ftp_proxy', 'haproxy', 'hwprobe', 'ids', 'iperf', 'ipsec', 'ipsec_legacy', 'lldpd', 'maltrail', 'mdns_repeater', 'monit', 'munin_node', 'netdata', 'netsnmp', 'nginx', 'node_exporter', 'nrpe', 'ntopng', 'nut', 'openconnect', 'openvpn', 'postfix', 'proxy', 'proxysso', 'puppet_agent', 'qemu_guest_agent', 'radsec_proxy', 'redis', 'relayd', 'rspamd', 'shadowsocks', 'shaper', 'siproxd', 'softether', 'sslh', 'stunnel', 'syslog', 'tayga', 'telegraf', 'tftp', 'tinc', 'tor', 'udp_broadcast_relay', 'unbound', 'vnstat', 'wireguard', 'zabbix_agent', 'zabbix_proxy'"
"name","string","true","\-","service, target, svc, n","Pretty name of the service to interact with. One of: 'acme_client', 'apcupsd', 'bind', 'captive_portal', 'chrony', 'cicap', 'clamav', 'collectd', 'cron', 'crowdsec', 'dns_crypt_proxy', 'dyndns', 'fetchmail', 'freeradius', 'frr', 'ftp_proxy', 'haproxy', 'hwprobe', 'ids', 'iperf', 'ipsec', 'ipsec_legacy', 'lldpd', 'maltrail', 'mdns_repeater', 'monit', 'munin_node', 'netdata', 'netsnmp', 'nginx', 'node_exporter', 'nrpe', 'ntopng', 'nut', 'openconnect', 'openvpn', 'postfix', 'proxy', 'proxysso', 'puppet_agent', 'qemu_guest_agent', 'radsec_proxy', 'redis', 'relayd', 'rspamd', 'shadowsocks', 'shaper', 'siproxd', 'softether', 'sslh', 'stunnel', 'syslog', 'tayga', 'telegraf', 'tftp', 'tinc', 'tor', 'udp_broadcast_relay', 'unbound', 'vnstat', 'wireguard', 'zabbix_agent', 'zabbix_proxy', 'kea' (dhcp)"
"action","string","true","\-","do, a","What action to execute. Some services may not support all of these actions (*the module will inform you in that case*). One of: 'status', 'start', 'reload', 'restart', 'stop'"

.. include:: ../_include/param_basic.rst
Expand Down
5 changes: 5 additions & 0 deletions plugins/modules/reload.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def run_module():
'ids',
'openvpn',
'dhcrelay',
'dhcp', 'kea',
],
description='What part of the running config should be reloaded'
),
Expand Down Expand Up @@ -162,6 +163,10 @@ def run_module():
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.dhcrelay_relay import \
DhcRelayRelay as Target_Obj

elif target in ['dhcp', 'kea']:
from ansible_collections.ansibleguy.opnsense.plugins.module_utils.main.dhcp_reservation_v4 import \
ReservationV4 as Target_Obj

except MODULE_EXCEPTIONS:
module_dependency_error()

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
},
# note: these would support more actions:
'ids': {}, 'proxy': {}, 'unbound': {},
'ids': {}, 'proxy': {}, 'unbound': {}, 'kea': {},
# plugins
'ftp_proxy': {'c': 'ftpproxy'},
'iperf': {'a': ['reload', 'status', 'start', 'restart']},
Expand Down
1 change: 1 addition & 0 deletions tests/reload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@
- 'ids'
- 'openvpn'
- 'dhcrelay'
- 'dhcp'
# - 'gateway' # issue 88

0 comments on commit 9a52237

Please sign in to comment.