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

Cannot add a resource parameter, when a default resource declaration already defines this param

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Needs Information
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 5.4.0
    • Fix Version/s: None
    • Component/s: Docs, Language
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      The following manifests fails with the error:

      Error: Parameter 'ignore' is already set on File[/tmp/puppet-test] by #<Puppet::Resource::Type:0x00000003659930> at /tmp/foo.pp:3; cannot redefine at /tmp/foo.pp:13 on node bla

      Manifest:

      File {
        ignore => '*.bak'
      }
      class foo {
        file{'/tmp/puppet-test':
          ensure => directory,
        }
        File['/tmp/puppet-test']{
          ignore => '*.bak2',
        }
      }
      include foo 

      while the following one works fine:

      File {
        ignore => '*.bak'
      }
      class foo {
        file{'/tmp/puppet-test':
          ensure => directory,
          ignore => '*.bak2',
        }
      }
      include foo

       

      This is just an example for a more complex case when the resource default is in manifests/site.pp as suggested by docs, while the resource declaration happens in a module class, where later in the same class we would add the ignore parameter.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            duritong Peter Meier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support