Skip to content

Commit

Permalink
Merge pull request #339 from anthonysomerset/add_interface_auto_ports
Browse files Browse the repository at this point in the history
adding support for interface_automatic_ports
  • Loading branch information
bastelfreak authored May 7, 2024
2 parents da22fa3 + 86cf46d commit 9b33258
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The following parameters are available in the `unbound` class:
* [`hints_file_content`](#-unbound--hints_file_content)
* [`unbound_version`](#-unbound--unbound_version)
* [`update_root_hints`](#-unbound--update_root_hints)
* [`interface_automatic_ports`](#-unbound--interface_automatic_ports)
* [`manage_service`](#-unbound--manage_service)
* [`verbosity`](#-unbound--verbosity)
* [`statistics_interval`](#-unbound--statistics_interval)
Expand Down Expand Up @@ -281,6 +282,14 @@ If set to true (and hints_file isn't set to 'builtin') a systemd timer will be c

Default value: `fact('systemd') ? { true => 'present', default => 'unmanaged'`

##### <a name="-unbound--interface_automatic_ports"></a>`interface_automatic_ports`

Data type: `Optional[String[1]]`

specifies the default ports to listen on when interface_automatic is also set to true, defaults to undef, specify as a string of space seperated ports e.g. "53 853 443"

Default value: `undef`

##### <a name="-unbound--manage_service"></a>`manage_service`

Data type: `Boolean`
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# the version of the installed unbound instance. defaults to the fact, but you can overwrite it. this reduces the initial puppet runs from two to one
# @param update_root_hints
# If set to true (and hints_file isn't set to 'builtin') a systemd timer will be configured to update the root hints file every month
# @param interface_automatic_ports
# specifies the default ports to listen on when interface_automatic is also set to true, defaults to undef, specify as a string of space seperated ports e.g. "53 853 443"
#
class unbound (
Boolean $manage_service = true,
Expand All @@ -20,6 +22,7 @@
Integer[0, 65535] $port = 53,
Array[String[1]] $interface = [],
Boolean $interface_automatic = false,
Optional[String[1]] $interface_automatic_ports = undef,
Array[String[1]] $outgoing_interface = [], # version 1.5.10
Optional[Integer[1]] $outgoing_range = undef,
Unbound::Range $outgoing_port_permit = '32768-65535',
Expand Down
3 changes: 3 additions & 0 deletions templates/unbound.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ server:
<%= print_config('port', @port) -%>
<%= print_config('interface', @interface) -%>
<%= print_config('interface-automatic', @interface_automatic) -%>
<% if @interface_automatic_ports -%>
<%= print_config('interface-automatic-ports', @interface_automatic_ports) -%>
<% end -%>
<%= print_config('outgoing-interface', @outgoing_interface) -%>
<%= print_config('outgoing-range', @outgoing_range) -%>
<%- if @outgoing_port_permit_first -%>
Expand Down

0 comments on commit 9b33258

Please sign in to comment.