Skip to content

Commit 19f81fe

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 19f81fe

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

REFERENCE.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ 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)
210+
* [`purge_conf_d`](#-unbound--purge_conf_d)
211211
* [`root_hints_url`](#-unbound--root_hints_url)
212212
* [`runtime_dir`](#-unbound--runtime_dir)
213213
* [`auto_trust_anchor_file`](#-unbound--auto_trust_anchor_file)
@@ -244,7 +244,6 @@ The following parameters are available in the `unbound` class:
244244
* [`redis_server_host`](#-unbound--redis_server_host)
245245
* [`redis_server_port`](#-unbound--redis_server_port)
246246
* [`redis_timeout`](#-unbound--redis_timeout)
247-
* [`unbound_conf_d`](#-unbound--unbound_conf_d)
248247
* [`hints_file`](#-unbound--hints_file)
249248
* [`update_root_hints`](#-unbound--update_root_hints)
250249
* [`hints_file_content`](#-unbound--hints_file_content)
@@ -1571,11 +1570,11 @@ 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`
1573+
##### <a name="-unbound--purge_conf_d"></a>`purge_conf_d`
15751574

15761575
Data type: `Boolean`
15771576

1578-
if true all unmanaged files in $unbound_conf_d will be purged
1577+
if true purge all unmanaged files in conf_d folder
15791578

15801579
Default value: `false`
15811580

@@ -1867,14 +1866,6 @@ see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
18671866

18681867
Default value: `100`
18691868

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-
18781869
##### <a name="-unbound--hints_file"></a>`hints_file`
18791870

18801871
Data type: `Unbound::Hints_file`

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: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
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
169+
# @param purge_conf_d if true purge all unmanaged files in conf_d folder
170170
# @param root_hints_url the url to download the root hints file
171171
# @param runtime_dir the runtime directory used
172172
# @param auto_trust_anchor_file see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
@@ -203,7 +203,6 @@
203203
# @param redis_server_host see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
204204
# @param redis_server_port see https://nlnetlabs.nl/documentation/unbound/unbound.conf/
205205
# @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
207206
# @param hints_file the root hints file to use
208207
# @param update_root_hints f we should update the root hints file
209208
# @param hints_file_content the contents of the root hints file
@@ -377,7 +376,7 @@
377376
# OpenBSD sets this to an empty string
378377
Variant[String,Array] $package_name = 'unbound',
379378
String[1] $package_ensure = 'installed',
380-
Boolean $purge_unbound_conf_d = false,
379+
Boolean $purge_conf_d = false,
381380
String[1] $root_hints_url = 'https://www.internic.net/domain/named.root',
382381
Stdlib::Absolutepath $runtime_dir = $confdir,
383382
Stdlib::Absolutepath $auto_trust_anchor_file = "${runtime_dir}/root.key",
@@ -414,14 +413,13 @@
414413
String[1] $redis_server_host = '127.0.0.1',
415414
Integer[1,65536] $redis_server_port = 6379,
416415
Integer[1] $redis_timeout = 100,
417-
Stdlib::Absolutepath $unbound_conf_d = "${confdir}/unbound.conf.d",
418416
Unbound::Hints_file $hints_file = "${confdir}/root.hints",
419417
Enum['absent','present','unmanaged'] $update_root_hints = fact('systemd') ? { true => 'present', default => 'unmanaged' },
420418
Optional[String[1]] $hints_file_content = undef,
421419
Hash[String[1], Unbound::Rpz] $rpzs = {},
422420
Optional[String[1]] $unbound_version = $facts['unbound_version'],
423421
) {
424-
$_base_dirs = [$confdir, $conf_d, $keys_d, $runtime_dir]
422+
$_base_dirs = [$confdir, $keys_d, $runtime_dir]
425423
$_piddir = if $pidfile { dirname($pidfile) } else { undef }
426424
if $_piddir and !($_piddir in ['/run', '/var/run']) {
427425
$dirs = unique($_base_dirs + [$_piddir])
@@ -541,12 +539,11 @@
541539
}
542540

543541
# purge unmanaged files in configuration directory
544-
file { $unbound_conf_d:
542+
file { $conf_d:
545543
ensure => 'directory',
546-
owner => 'root',
547-
group => '0',
548-
purge => $purge_unbound_conf_d,
549-
recurse => $purge_unbound_conf_d,
544+
owner => $owner,
545+
purge => $purge_conf_d,
546+
recurse => $purge_conf_d,
550547
}
551548

552549
concat { $config_file:

0 commit comments

Comments
 (0)