Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11218

require metaparam cannot be assinged to defined resource if inside var is named $require

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 6.23.0
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
    • Template:
    • Team:
      Coremunity
    • QA Risk Assessment:
      Needs Assessment

      Description

      Hi,
      if I'm using a variable named `$require` within a defined resource,I cannot add the $require metaparameter to it. Failing code:

      package { 'htop':
        ensure => 'insalled'
      }
      define bla {
        $require = 'a string'
        notify { $require:}
      }
       
      bla {'foobar':
        require => Package['htop'],
      }
      

      this fails during a puppet apply with:

      Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Cannot reassign variable '$require'
      

      I can reproduce this on Puppet 6.23.0 on Arch Linux. I checked https://puppet.com/docs/puppet/6/lang_reserved.html and require isn't listed as reserved keyword.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            bastelfreak Tim Meusel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support