Skip to content

Commit 1b8aa73

Browse files
committed
Use stdlib functions for hash key discovery
When fiddling around with server names in the configuration, you'd have to do a clean sweep of the whole configuration to ensure that there are no problems with the fact existence and the ordering. Using dig (and has_key for compatibility reasons to not change anything front-facing), we can avoid this problem.
1 parent 4a589f7 commit 1b8aa73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

manifests/deploy/export.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
-> Openvpn::Client[$name]
1919
-> Openvpn::Deploy::Export[$name]
2020

21-
if $facts['openvpn'] {
22-
if $facts['openvpn'][$server][$name] {
21+
if has_key($facts, 'openvpn') {
22+
if dig44($facts, ['openvpn', $server, $name], false) {
2323
$data = $facts['openvpn'][$server][$name]
2424

2525
@@file { "exported-${server}-${name}-config":

0 commit comments

Comments
 (0)