Skip to content

Commit 3f66b62

Browse files
committed
conf_d: merge the unbound_conf_d and conf_d params
AFAICT the intention of theses two parameters is the same so lets merge them fixes #342
1 parent 737a023 commit 3f66b62

File tree

3 files changed

+17
-29
lines changed

3 files changed

+17
-29
lines changed

REFERENCE.md

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ The following parameters are available in the `unbound` class:
207207
* [`username`](#-unbound--username)
208208
* [`package_name`](#-unbound--package_name)
209209
* [`package_ensure`](#-unbound--package_ensure)
210-
* [`purge_unbound_conf_d`](#-unbound--purge_unbound_conf_d)
211210
* [`root_hints_url`](#-unbound--root_hints_url)
212211
* [`runtime_dir`](#-unbound--runtime_dir)
213212
* [`auto_trust_anchor_file`](#-unbound--auto_trust_anchor_file)
@@ -244,12 +243,12 @@ The following parameters are available in the `unbound` class:
244243
* [`redis_server_host`](#-unbound--redis_server_host)
245244
* [`redis_server_port`](#-unbound--redis_server_port)
246245
* [`redis_timeout`](#-unbound--redis_timeout)
247-
* [`unbound_conf_d`](#-unbound--unbound_conf_d)
248246
* [`hints_file`](#-unbound--hints_file)
249247
* [`update_root_hints`](#-unbound--update_root_hints)
250248
* [`hints_file_content`](#-unbound--hints_file_content)
251249
* [`rpzs`](#-unbound--rpzs)
252250
* [`unbound_version`](#-unbound--unbound_version)
251+
* [`purge_conf_d`](#-unbound--purge_conf_d)
253252

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

@@ -1571,14 +1570,6 @@ the ensure value for the packages
15711570

15721571
Default value: `'installed'`
15731572

1574-
##### <a name="-unbound--purge_unbound_conf_d"></a>`purge_unbound_conf_d`
1575-
1576-
Data type: `Boolean`
1577-
1578-
if true all unmanaged files in $unbound_conf_d will be purged
1579-
1580-
Default value: `false`
1581-
15821573
##### <a name="-unbound--root_hints_url"></a>`root_hints_url`
15831574

15841575
Data type: `String[1]`
@@ -1867,14 +1858,6 @@ see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
18671858

18681859
Default value: `100`
18691860

1870-
##### <a name="-unbound--unbound_conf_d"></a>`unbound_conf_d`
1871-
1872-
Data type: `Stdlib::Absolutepath`
1873-
1874-
similar to conf_d, will be merged with conf_d version in future
1875-
1876-
Default value: `"${confdir}/unbound.conf.d"`
1877-
18781861
##### <a name="-unbound--hints_file"></a>`hints_file`
18791862

18801863
Data type: `Unbound::Hints_file`
@@ -1916,6 +1899,14 @@ specifying reduces the number of puppet runs
19161899

19171900
Default value: `$facts['unbound_version']`
19181901

1902+
##### <a name="-unbound--purge_conf_d"></a>`purge_conf_d`
1903+
1904+
Data type: `Boolean`
1905+
1906+
1907+
1908+
Default value: `false`
1909+
19191910
### <a name="unbound--remote"></a>`unbound::remote`
19201911

19211912
Configure remote control of the unbound daemon process

data/os/Debian.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
unbound::pidfile: '/run/unbound.pid'
33
unbound::runtime_dir: '/var/lib/unbound'
4-
unbound::purge_unbound_conf_d: true
4+
unbound::conf_d: "%{confdir}/unbound.conf.d"
5+
unbound::purge_conf_d: true

manifests/init.pp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@
166166
# @param username see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
167167
# @param package_name The package(s) to install to get unbound
168168
# @param package_ensure the ensure value for the packages
169-
# @param purge_unbound_conf_d if true all unmanaged files in $unbound_conf_d will be purged
170169
# @param root_hints_url the url to download the root hints file
171170
# @param runtime_dir the runtime directory used
172171
# @param auto_trust_anchor_file see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
@@ -203,7 +202,6 @@
203202
# @param redis_server_host see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
204203
# @param redis_server_port see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
205204
# @param redis_timeout see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
206-
# @param unbound_conf_d similar to conf_d, will be merged with conf_d version in future
207205
# @param hints_file the root hints file to use
208206
# @param update_root_hints f we should update the root hints file
209207
# @param hints_file_content the contents of the root hints file
@@ -377,7 +375,7 @@
377375
# OpenBSD sets this to an empty string
378376
Variant[String,Array] $package_name = 'unbound',
379377
String[1] $package_ensure = 'installed',
380-
Boolean $purge_unbound_conf_d = false,
378+
Boolean $purge_conf_d = false,
381379
String[1] $root_hints_url = 'https://www.internic.net/domain/named.root',
382380
Stdlib::Absolutepath $runtime_dir = $confdir,
383381
Stdlib::Absolutepath $auto_trust_anchor_file = "${runtime_dir}/root.key",
@@ -414,14 +412,13 @@
414412
String[1] $redis_server_host = '127.0.0.1',
415413
Integer[1,65536] $redis_server_port = 6379,
416414
Integer[1] $redis_timeout = 100,
417-
Stdlib::Absolutepath $unbound_conf_d = "${confdir}/unbound.conf.d",
418415
Unbound::Hints_file $hints_file = "${confdir}/root.hints",
419416
Enum['absent','present','unmanaged'] $update_root_hints = fact('systemd') ? { true => 'present', default => 'unmanaged' },
420417
Optional[String[1]] $hints_file_content = undef,
421418
Hash[String[1], Unbound::Rpz] $rpzs = {},
422419
Optional[String[1]] $unbound_version = $facts['unbound_version'],
423420
) {
424-
$_base_dirs = [$confdir, $conf_d, $keys_d, $runtime_dir]
421+
$_base_dirs = [$confdir, $keys_d, $runtime_dir]
425422
$_piddir = if $pidfile { dirname($pidfile) } else { undef }
426423
if $_piddir and !($_piddir in ['/run', '/var/run']) {
427424
$dirs = unique($_base_dirs + [$_piddir])
@@ -541,12 +538,11 @@
541538
}
542539

543540
# purge unmanaged files in configuration directory
544-
file { $unbound_conf_d:
541+
file { $conf_d:
545542
ensure => 'directory',
546-
owner => 'root',
547-
group => '0',
548-
purge => $purge_unbound_conf_d,
549-
recurse => $purge_unbound_conf_d,
543+
owner => $owner,
544+
purge => $purge_conf_d,
545+
recurse => $purge_conf_d,
550546
}
551547

552548
concat { $config_file:

0 commit comments

Comments
 (0)