Skip to content

Commit

Permalink
conf_d: merge the unbound_conf_d and conf_d params
Browse files Browse the repository at this point in the history
AFAICT the intention of theses two parameters is the same so lets merge
them

fixes #342
  • Loading branch information
b4ldr committed Aug 29, 2024
1 parent c3e537b commit 3783674
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion data/os/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
unbound::pidfile: '/run/unbound.pid'
unbound::runtime_dir: '/var/lib/unbound'
unbound::purge_unbound_conf_d: true
unbound::conf_d: "%{confdir}/unbound.conf.d"
unbound::purge_conf_d: true
14 changes: 6 additions & 8 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
# OpenBSD sets this to an empty string
Variant[String,Array] $package_name = 'unbound',
String[1] $package_ensure = 'installed',
Boolean $purge_unbound_conf_d = false,
Boolean $purge_conf_d = false,
String[1] $root_hints_url = 'https://www.internic.net/domain/named.root',
Stdlib::Absolutepath $runtime_dir = $confdir,
Stdlib::Absolutepath $auto_trust_anchor_file = "${runtime_dir}/root.key",
Expand Down Expand Up @@ -218,14 +218,13 @@
String[1] $redis_server_host = '127.0.0.1',
Integer[1,65536] $redis_server_port = 6379,
Integer[1] $redis_timeout = 100,
Stdlib::Absolutepath $unbound_conf_d = "${confdir}/unbound.conf.d",
Unbound::Hints_file $hints_file = "${confdir}/root.hints",
Enum['absent','present','unmanaged'] $update_root_hints = fact('systemd') ? { true => 'present', default => 'unmanaged' },
Optional[String[1]] $hints_file_content = undef,
Hash[String[1], Unbound::Rpz] $rpzs = {},
Optional[String[1]] $unbound_version = $facts['unbound_version'],
) {
$_base_dirs = [$confdir, $conf_d, $keys_d, $runtime_dir]
$_base_dirs = [$confdir, $keys_d, $runtime_dir]
$_piddir = if $pidfile { dirname($pidfile) } else { undef }
if $_piddir and !($_piddir in ['/run', '/var/run']) {
$dirs = unique($_base_dirs + [$_piddir])
Expand Down Expand Up @@ -345,12 +344,11 @@
}

# purge unmanaged files in configuration directory
file { $unbound_conf_d:
file { $conf_d:
ensure => 'directory',
owner => 'root',
group => '0',
purge => $purge_unbound_conf_d,
recurse => $purge_unbound_conf_d,
owner => $owner,
purge => $purge_conf_d,
recurse => $purge_conf_d,
}

concat { $config_file:
Expand Down

0 comments on commit 3783674

Please sign in to comment.