Re: [Puppet Users] Check existence of a hierarchy

2018-07-11 Thread Helmut Schneider
Ben Ford wrote: > What you're looking for is the dig() function. > https://puppet.com/docs/puppet/latest/function.html#dig > > $profiles.dig('vpn', 'openvpn', 'instances', 'client') > > On Wed, Jul 11, 2018 at 8:32 AM Helmut Schneider > wrote: > > > Hello all, > > > > let's assume the followi

Re: [Puppet Users] Check existence of a hierarchy

2018-07-11 Thread Ben Ford
What you're looking for is the dig() function. https://puppet.com/docs/puppet/latest/function.html#dig $profiles.dig('vpn', 'openvpn', 'instances', 'client') On Wed, Jul 11, 2018 at 8:32 AM Helmut Schneider wrote: > Hello all, > > let's assume the following structure in a yaml: > > profiles: >

[Puppet Users] Check existence of a hierarchy

2018-07-11 Thread Helmut Schneider
Hello all, let's assume the following structure in a yaml: profiles: vpn: openvpn: instances: client: myclient: remote: 'openvpn_host 1194' I would now like to check if e.g. "client" exists: if ($profiles['vpn']['openvpn']['instances']['client