Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Harry Lee commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet Henrik Lindberg Thank you, it's helpful. We are running puppet 4 with `--noop`, and grep all `should be` notice message which means those templates may have undefined variable causing content change. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet In that case, if you are Ruby savvy you may want to look into how this is done in Puppet and make a patch to your own version of puppet that helps you detect the unwanted cases as that may be less work than the manual work searching for those. A kind of haskish variant would be to write out all variable resolutions as they occur in 3.8.7 (per template) and write that out to disk. Then do the same on Puppet 4. Diff the two outputs. A simpler alternative is to try this with catalog-preview - diffs in template resolution should show up as diffs in the catalog. That way you would at least find the templates having trouble. However, I am not certain if 3.8 with future parser actually has the change you are seeing with ERB in Puppet 4. Try that first. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Harry Lee commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet Henrik Lindberg Okay, thanks. We're using puppet 3.8.7. Because puppet 4 remove the dynamic scope support for erb template, we need to check all our erb templates manually to ensure they are not accessing variables from another scope. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet Harry Lee Sorry, cannot do anything at all about that - you are in Ruby and the reference to something like @world could be anything - Puppet is not involved in resolving that _expression_ to a value. If you in your template instead try to lookup values in the scope you would get errors. We think EPP is a much better alternative than ERB since the use of ERB lacks guardrails. With EPP you would get the errors and warnings. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Harry Lee commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet Henrik Lindberg I mean, it not worked in an erb template. $puppet apply -e "notice inline_template('hello <%= @world %>')" --strict_variables Notice: Scope(Class[main]): hello Notice: Compiled catalog for sa.intra.douban.com in environment production in 0.12 seconds Notice: Applied catalog in 0.01 seconds Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet henrik$ puppet apply -e 'notice $santa' Warning: Unknown variable: 'santa'. at line 1:8 Notice: Scope(Class[main]): Notice: Compiled catalog for henrik2 in environment production in 0.02 seconds henrik$ puppet apply -e 'notice $santa' --strict_variables Error: Evaluation Error: Unknown variable: 'santa'. at line 1:8 on node henrik2 The --strict_variables is a setting that you can have in your configuration. On the command line it is just --strict_variables to turn it on. Add Comment
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Harr commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet > Similarly, if you try to use an undefined variable inside a template, in interpolates to an empty string. Henrik Lindberg Hi, I want puppet catalog compilation to raise error when it try to access a undefined variable. How can I achieve that? I've tried strict_variables = true but it does not worked. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Henrik Lindberg Fix Version/s: PUP 4.4.0 Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Henrik Lindberg Sprint: Language 2016-02-24 (Burn FF) Triage Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg commented on PUP-1540 Re: Add strict_variables = warn Option To Puppet Turns out that we do emit warnings, but not for all cases. See PUP-1780. This ticket PUP-1540 has been repurposed once. And it is now a bit confusing as to which ticket to fix. I think just adding additional warnings in PUP-1780 is the right thing to do, as puppet is already warning for some cases. i.e. we do not need the option, it will always warn. Anyway, PUP-1780 needs to be fixed before this. Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Henrik Lindberg Sprint: Language 2016-02- 10 24 (Burn FF) Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Henrik Lindberg Sprint: Language Triage 2016-01-27 Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Steve Barlow updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Steve Barlow Sprint: Language 2016- 01 02 - 27 10 Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Nick Walker updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Nick Walker Summary: Add strict_variables = warn Option To Puppet should support compilation failure if a variable is undefined Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-1540) Add strict_variables = warn Option To Puppet
Title: Message Title Nick Walker updated an issue Puppet / PUP-1540 Add strict_variables = warn Option To Puppet Change By: Nick Walker h1. Updated Description 1/12/2015We introduced the strict_variables option to puppet which causes catalog compilation to fail if a variable is used that was never declared. https://docs.puppetlabs.com/references/latest/configuration.html#strictvariablesIn order to make it easier for users to correct existing code that may already reference variables that do not exist it'd be great to be able to set strict_variables to warn so that it printed out warnings when running `puppet agent -t` and logged the warning as well. h2. Original Description Currently, if a variable is undefined in puppet code, compilation succeeds, and the value is undef. E.g.{noformat}notify { $foo: }{noformat}results in{noformat}Notice: /Stage[main]//Notify[undef]/message: defined 'message' as 'undef'{noformat}Similarly, if you try to use an undefined variable inside a template, in interpolates to an empty string.The problem with this is that you don't generally want an empty string inside your config file.Therefore, it would be useful if puppet could run in a "strict" mode, where variable interpolation failures equal failed compile.Essentially, the equivalent of this, but for all variables:{noformat}if $foo {}else {fail('$foo is undefined')}{noformat}This is something users could implement, but on a per-variable basis is quite onerous. Add Comment This message was sent by Atlassian JIRA (v6.4.12#64027-sha1:e3691cc) -- You received this message because you are