On Sun, Aug 12, 2012 at 9:51 PM, Samuel Martin Moro <[email protected]>wrote:

> **
> On 07/03/2012 07:56 PM, [email protected] wrote:
>
>  Issue #14301 has been updated by Brice Figureau.
>
>
> Currently the right hand part of the selector (selector values) only
> supports rvalues, and hashes are not rvalues. We could promote those
> selector values to full-blown expressions (which covers much more than
> rvalues), FTW.
>
>
> Hi,
>
> I'm desperately updating my master waiting for a fix regarding this issue.
> Is this somewhat in the roadmap?
>
> I use this kind of syntax to set a bunch of variables for IPSEC tunnels
> within 20 offices.
> It gives something like this:
>
> $var1 = $office ? {
> 'office1' => { 'office2' => 'aes', 'office3' => '3des', [...], 'office20'
> => 'aes-256' },
> 'office2' => { 'office1' => 'aes', 'office3' => 'aes', [...], 'office20'
> => 'aes-256' },
> [...]
> 'office20' => { 'office1' => 'aes-256', 'office2' => 'aes-256', 'office3'
> => 'des', [...] }
> }
>
> I'm setting 8 variables using this scheme (in a 3260 lines .pp file).
> This is used with 40 OpenBSD 4.9 nodes, and works as a charm.
>
> And now, this syntax is just not supported anymore?
>
> Not looking for the troll here, still: if I have to script something,
> generating a
> "working" pp file from my side (using if/else statements, arrays, ...),
> then this looks
> like some puppet regression.
> Finding this ticket, I'm surprised this is not considered as a critical
> issue.
>
>
> Kind regards.
>
> --
> Samuel Martin Moro
> Smile - Open Source Solutions
>
>  ------------------------------
> Bug #14301: Hashes can not be used in selectors (upgrading from
> 2.7.1->2.7.14) <https://projects.puppetlabs.com/issues/14301#change-66257>
>
>    - Author: Kristian Kostecky
>    - Status: Accepted
>    - Priority: Normal
>    - Assignee:
>    - Category: server
>    - Target version:
>    - Affected Puppet version: 2.7.14
>    - Keywords:
>    - Branch:
>
> After upgrading from puppet 2.7.1 –> 2.7.14, I noticed that all the
> selectors that assigned hashes caused a parse error. I re-wrote them as if
> conditionals to bypass the issue, but I believe this is a bug.
>
> Example:
>
> $test = $fqdn ? {
>
> 'test'  => { 'test' => 'test', 't' => 't' },
> default => { 'test' => 'test', 't' => 't' },
>
>  }
>
> Gives: err: Could not retrieve catalog from remote server: Error 400 on
> SERVER: Could not parse for environment production: Syntax error at ‘{’;
> expected ‘}’ at XXXXXX
>
>
>
Well, I've finally done it: I've wrote a shell script (1200 lines of vars,
120 lines of code) generating a 5000 lines manifest using if/else
statements.

Anyway, it may be good to have a look at why this doesn't work anymore.

Kind regards.

-- 
Samuel Martín Moro
{EPITECH.} 2011
SMILE - Open Source Solutions

"Nobody wants to say how this works.
 Maybe nobody knows ..."
                      Xorg.conf(5)

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to