Bryan Schneiders
2009-Oct-07 22:18 UTC
[Puppet Users] regular expressions do not work with selectors as shown in documentation
The documentation at: http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#conditionals says: """ Starting with version 0.25, selectors now support regular expressions: $owner = $operatingsystem ? { /(redhat|debian)/ => "bin", default => undef, } In this last example, if $operatingsystem matches either redhat or debian, then bin will be the selected result. """ When I try something like this, I get: Syntax error at ''/''; expected ''}'' If I put quotes around it, it doesn''t act as a regular expression and fails to match. If I use just "RedHat" without a regular expression, then it matches when the operating system is RedHat. I''m using: puppet-0.24.8-1.fc10.noarch puppet-server-0.24.8-1.fc10.noarch Is the bug in puppet or the documentation? Does anyone know the correct syntax? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Bryan
2009-Oct-07 22:21 UTC
[Puppet Users] Re: regular expressions do not work with selectors as shown in documentation
OK. I just noticed I''m not running version 0.25 as is glaringly obvious from the contents of my email. My mistake. Sorry for the post. On Wed, Oct 7, 2009 at 6:18 PM, Bryan Schneiders <bryan.schneiders@gmail.com> wrote:> The documentation at: > http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#conditionals > > says: > """ > Starting with version 0.25, selectors now support regular expressions: > > $owner = $operatingsystem ? { > /(redhat|debian)/ => "bin", > default => undef, > } > > In this last example, if $operatingsystem matches either redhat or > debian, then bin will be the selected result. > """ > > When I try something like this, I get: > Syntax error at ''/''; expected ''}'' > > If I put quotes around it, it doesn''t act as a regular expression and > fails to match. If I use just "RedHat" without a regular expression, > then it matches when the operating system is RedHat. > > I''m using: > puppet-0.24.8-1.fc10.noarch > puppet-server-0.24.8-1.fc10.noarch > > Is the bug in puppet or the documentation? Does anyone know the > correct syntax?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Todd Zullinger
2009-Oct-07 23:13 UTC
[Puppet Users] Re: regular expressions do not work with selectors as shown in documentation
Bryan wrote:> OK. I just noticed I''m not running version 0.25 as is glaringly > obvious from the contents of my email. My mistake. Sorry for the > post.Though if you want to try 0.25.1rc1, there are packages available at: http://tmz.fedorapeople.org/repo/puppet/ If you grab the puppet.repo file from http://tmz.fedorapeople.org/repo/puppet/fedora/puppet.repo and save it in /etc/yum.repos.d, you can easily update via yum. -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When you make a mistake, make amends immediately. It''s easier to eat crow while it''s still warm.