Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Helmut Schneider
Henrik Lindberg wrote: > On 2018-07-13 19:39, Helmut Schneider wrote: > > Christopher Wood wrote: > > > > > Nice catch, wouldn't have figured on that. > > > > You gave the hint with "if value.is_a? String" ;) > > > > And now? Is that expected? What can I do, "if > >

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Henrik Lindberg
On 2018-07-13 19:39, Helmut Schneider wrote: Christopher Wood wrote: Nice catch, wouldn't have figured on that. You gave the hint with "if value.is_a? String" ;) And now? Is that expected? What can I do, "if @openvpnConf[parameter].is_a? Symbol"?! And what is a symbol and how do I check if

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Helmut Schneider
Christopher Wood wrote: > Nice catch, wouldn't have figured on that. You gave the hint with "if value.is_a? String" ;) And now? Is that expected? What can I do, "if @openvpnConf[parameter].is_a? Symbol"?! And what is a symbol and how do I check if it empty? Even more questionmark now... --

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Christopher Wood
Nice catch, wouldn't have figured on that. On Fri, Jul 13, 2018 at 05:17:05PM +, Helmut Schneider wrote: > Christopher Wood wrote: > > > On Fri, Jul 13, 2018 at 03:44:04PM +, Helmut Schneider wrote: > > > Christopher Wood wrote: > > > > > > > Have you considered switching to an EPP

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Helmut Schneider
Christopher Wood wrote: > On Fri, Jul 13, 2018 at 03:44:04PM +, Helmut Schneider wrote: > > Christopher Wood wrote: > > > > > Have you considered switching to an EPP template? You can limit > > > the data passed in to only valid types (otherwise catalog > > > compilation failure), it's quite

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Christopher Wood
On Fri, Jul 13, 2018 at 03:44:04PM +, Helmut Schneider wrote: > Christopher Wood wrote: > > > Have you considered switching to an EPP template? You can limit the > > data passed in to only valid types (otherwise catalog compilation > > failure), it's quite useful. > > Not yet. And I'm not

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Helmut Schneider
Christopher Wood wrote: > Have you considered switching to an EPP template? You can limit the > data passed in to only valid types (otherwise catalog compilation > failure), it's quite useful. Not yet. And I'm not sure if that will help. In my case there are commands with and without parameters:

Re: [Puppet Users] undef / nil / empty in template

2018-07-13 Thread Christopher Wood
Have you considered switching to an EPP template? You can limit the data passed in to only valid types (otherwise catalog compilation failure), it's quite useful. https://puppet.com/docs/puppet/5.5/lang_template_epp.html In the example below, you might do something like: $content =

[Puppet Users] undef / nil / empty in template

2018-07-13 Thread Helmut Schneider
Hi, openvpn.yaml: [...] profiles: vpn: openvpn: defaults: client: dev: 'tun' proto: 'udp' resolv-retry: 'infinite' nobind: user: 'nobody' group: 'nogroup'

Re: [Puppet Users] Hiera and nested / reuse variables

2018-07-13 Thread Helmut Schneider
Angel L. Mateo wrote: > El 21/06/18 a las 14:32, Helmut Schneider escribió: > > Hi, > > > > common.yaml: > > > > profiles: > >mailserver: > > postfix: > >instances: > > postfix-in: > >instance_path: '/etc/postfix-in' > >other_path: