Hi all, We are currently using the regsubst function of Puppet to generate some information out of our hostnames (customer, environment, and so.). The manifest is running fine since months. 7: $customer = regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1") 8: $environment = regsubst($::fqdn, ''^[^-]*-([^-]*).*'', "\\1") 9: $product = regsubst($::fqdn, ''^[^-]*-[^-]*-([^\.1-9]*).*'', "\\1") Last week I discovered the stdlib module and added the module to my Puppet environment. After rolling out some changes to a test machine, I encountered some problems. err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function ''regsubst'' does not return a value at /etc/puppet/environments/dev_foo/modules/auth/manifests/hosting.pp:7 on node unic-dev-bei.p.unic24.net The regsubst function does not work like before. We did not upgrade our Puppet installation (version 2.7.18) or anything like that. What confuses me most, is that even running Puppet against our production environment produces the same error. So the only change I did is adding the stdlib module. Could it be that this may broke the regsubst function? Cheers, Christian -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Hi all, I have a tricky problem where I need your support. We use the regsubst function in one of our manifests to extract certain information from the fqdn. That code is running in production since months and does extactly what it should. 7: $customer = upcase(regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1")) 8: $environment = upcase(regsubst($::hostname, ''^[^-]*-([^-]*).*'', "\\1")) 9: $product = upcase(regsubst($::hostname, ''^[^-]*-[^-]*-([^\.1-9]*).*'', "\\1")) Last week I discovered the stdlib module from PuppetLabs and gave it a try. Really nice functions, and I used them of course for my next module. But since then it looks like the regsubst function is not working anymore. err: Could not retrieve catalog from remote server: Error 400 on SERVER: Function ''regsubst'' does not return a value at /etc/puppet/environments/dev_foo/modules/auth/manifests/hosting.pp:7 on node unic-dev-foo.p.unic24.net It even fails when I run puppet against a environment without the stdlib module, which confuses me most. Does anybody of you have an idea, why that code now fails? We use Puppet 2.7.18. Cheers, Christian -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Jun-11 12:53 UTC
[Puppet Users] Re: Does stdlib break the regsubst function?
On Tuesday, June 11, 2013 1:10:16 AM UTC-5, c!w wrote:> > Hi all, > I have a tricky problem where I need your support. We use the regsubst > function in one of our manifests to extract certain information from the > fqdn. That code is running in production since months and does extactly > what it should. > > 7: $customer = upcase(regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1")) > 8: $environment = upcase(regsubst($::hostname, ''^[^-]*-([^-]*).*'', "\\1")) > 9: $product = upcase(regsubst($::hostname, ''^[^-]*-[^-]*-([^\.1-9]*).*'', > "\\1")) > > Last week I discovered the stdlib module from PuppetLabs and gave it a > try. Really nice functions, and I used them of course for my next module. > But since then it looks like the regsubst function is not working anymore. > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Function ''regsubst'' does not return a value at > /etc/puppet/environments/dev_foo/modules/auth/manifests/hosting.pp:7 on > node unic-dev-foo.p.unic24.net > > It even fails when I run puppet against a environment without the stdlib > module, which confuses me most. >That part confuses me least. Puppet does not segregate custom functions or types based on environment. If one of the stdlib native components is somehow breaking regsubst(), then it is to be expected that it would be seen in all environments.> Does anybody of you have an idea, why that code now fails? We use > Puppet 2.7.18. > >And what version of stdlib did you install? Support for Puppet 2.7 was dropped as of stdlib 4.0.0. (Current is 4.1.0; see https://forge.puppetlabs.com/puppetlabs/stdlib.) Like most other things Puppet, stdlib moves fairly quickly, so stdlib 3 isn''t actually all that old. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Yes, therefore we use stdlib 3.2.0. Christian Am Dienstag, 11. Juni 2013 14:53:50 UTC+2 schrieb jcbollinger:> > > > On Tuesday, June 11, 2013 1:10:16 AM UTC-5, c!w wrote: >> >> Hi all, >> I have a tricky problem where I need your support. We use the regsubst >> function in one of our manifests to extract certain information from the >> fqdn. That code is running in production since months and does extactly >> what it should. >> >> 7: $customer = upcase(regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1")) >> 8: $environment = upcase(regsubst($::hostname, ''^[^-]*-([^-]*).*'', >> "\\1")) >> 9: $product = upcase(regsubst($::hostname, ''^[^-]*-[^-]*-([^\.1-9]*).*'', >> "\\1")) >> >> Last week I discovered the stdlib module from PuppetLabs and gave it a >> try. Really nice functions, and I used them of course for my next module. >> But since then it looks like the regsubst function is not working anymore. >> >> err: Could not retrieve catalog from remote server: Error 400 on SERVER: >> Function ''regsubst'' does not return a value at >> /etc/puppet/environments/dev_foo/modules/auth/manifests/hosting.pp:7 on >> node unic-dev-foo.p.unic24.net >> >> It even fails when I run puppet against a environment without the stdlib >> module, which confuses me most. >> > > > That part confuses me least. Puppet does not segregate custom functions > or types based on environment. If one of the stdlib native components is > somehow breaking regsubst(), then it is to be expected that it would be > seen in all environments. > > > >> Does anybody of you have an idea, why that code now fails? We use >> Puppet 2.7.18. >> >> > > And what version of stdlib did you install? Support for Puppet 2.7 was > dropped as of stdlib 4.0.0. (Current is 4.1.0; see > https://forge.puppetlabs.com/puppetlabs/stdlib.) Like most other things > Puppet, stdlib moves fairly quickly, so stdlib 3 isn''t actually all that > old. > > > John > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Jun-11 20:16 UTC
[Puppet Users] Re: Does stdlib break the regsubst function?
On Tuesday, June 11, 2013 7:58:39 AM UTC-5, c!w wrote:> > Yes, therefore we use stdlib 3.2.0. > >Lots of people use stdlib, and lots of people use regsubst(), so you are unlikely to be the only person using them together. I have not heard any other reports of the behavior you describe, however, nor do I find any reports of it on the PL bug tracker (not even closed ones). Whatever the nature of your problem, therefore, I suspect that there''s more to it than simply stdlib breaking regsubst(). It may be illuminating to create a simplified test case. Build a new, clean, v 2.7.18 master, install stdlib 3.2.0 in it, and deploy a very simple manifest that exercises regsubst(). Something like this might do the trick: site.pp =====node default { $value = ''foo'' $subst = regsubst($value, ''f'', ''b'') notice("Ghosts say ''$subst''") } If the problem is a straight-up incompatibility between stdlib and the Puppet core, then any time the master tries to compile a catalog it ought to experience your error. If it does, then you have a test case you can submit when you file a ticket against the issue. Otherwise, either you have clobbered your primary master some other way, or else the issue is more complicated than you suppose. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Pete Brown
2013-Jun-13 06:47 UTC
Re: [Puppet Users] Does stdlib break the regsubst function?
Which version of stdlib are you running? I would hazard a guess that the version you have installed isn''t the right one for your puppet version. Basically 4.x only works on puppet 3.x with no support for earlier versions. 3.x is for puppet 2.7 and 3 with no support for earlier versions 2.x is for puppet 2.6 and 2.7 with no support for puppet 3. There is a version matrix on the forge page for stdlib. On 10 June 2013 17:27, c!w <wittwerch@gmail.com> wrote:> Hi all, > We are currently using the regsubst function of Puppet to generate some > information out of our hostnames (customer, environment, and so.). The > manifest is running fine since months. > > 7: $customer = regsubst($::fqdn, ''(^[^-]*)-[^-]*.*'', "\\1") > 8: $environment = regsubst($::fqdn, ''^[^-]*-([^-]*).*'', "\\1") > 9: $product = regsubst($::fqdn, ''^[^-]*-[^-]*-([^\.1-9]*).*'', "\\1") > > Last week I discovered the stdlib module and added the module to my Puppet > environment. After rolling out some changes to a test machine, I > encountered some problems. > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Function ''regsubst'' does not return a value at > /etc/puppet/environments/dev_foo/modules/auth/manifests/hosting.pp:7 on > node unic-dev-bei.p.unic24.net > > The regsubst function does not work like before. We did not upgrade our > Puppet installation (version 2.7.18) or anything like that. What confuses > me most, is that even running Puppet against our production environment > produces the same error. > So the only change I did is adding the stdlib module. Could it be that > this may broke the regsubst function? > > Cheers, > Christian > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to puppet-users+unsubscribe@googlegroups.com. > To post to this group, send email to puppet-users@googlegroups.com. > Visit this group at http://groups.google.com/group/puppet-users?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.