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

    • Task
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 6.23.0
    • None
    • Compiler
    • None
    • Coremunity
    • 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

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

            Dates

              Created:
              Updated:

              Zendesk Support