Re: [Puppet Users] Validating more than one type of data structure at a time

2015-06-03 Thread Jacob McCoy Wade
This would be a nice elegant solution, however we have not turned the future parser on quite yet. I will certainly keep this function in mind though in the future. > On Jun 3, 2015, at 5:56 AM, Henrik Lindberg > wrote: > > On 2015-03-06 6:26, Jacob McCoy Wade wrote: >> I

Re: [Puppet Users] Validating more than one type of data structure at a time

2015-06-03 Thread Jacob McCoy Wade
lso from stdlib) which return true or false but > dont fail. > > if ( is_string($myvar) or is_hash($myvar) ) { > ... > } else { > fail('not a string or a hash') > } > > > Regards > Craig > > > On Wed, Jun 3, 2015 at 6:26 AM, Jacob McCoy Wade

[Puppet Users] Validating more than one type of data structure at a time

2015-06-02 Thread Jacob McCoy Wade
I am trying to find out how I can validate more than one type of data structure for a given value in a manifest? In particular I would like to be able to have either a string or a hash be a valid data structure. Something like: if ($myvar != false) { validate_string($myvar) || validate_hash($my

[Puppet Users] Re: escape sequence within generate function

2013-08-02 Thread Jacob McCoy Wade
On Friday, August 2, 2013 6:43:01 AM UTC-7, jcbollinger wrote: > > > > On Thursday, August 1, 2013 2:37:03 PM UTC-5, Jacob McCoy Wade wrote: >> >> The closest I've come is to use: >> >>> $random_1 = generate('/bin/sh', '-c', '

[Puppet Users] escape sequence within generate function

2013-08-01 Thread Jacob McCoy Wade
I'm looking for some help in getting the proper escape sequence within the generate function. Ultimately what I'm trying to do is generate some random strings, store them as variables, and use those variables to populate configuration files stored as templates. I can get this to work when applyi