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

resources type fails to purge package when packages exist whose $name != $title

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 5.5.17
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Template:
      PUP Bug Template
    • Agent OS:
      RHEL 7 (x86_64)
    • Team:
      Coremunity
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 5.5.17
      Puppet Server Version: n/a (fails also on puppet apply)
      OS Name/Version: RHEL 7.6

      Experimenting to remove unmanaged packages, I have experimented with the following stanza:

      resources {'package':
        purge => true,
      } 

      Because it is not uncommon for various modules to define package resources with differing titles and names, such as:

      package {'http-server':
        name => 'apache24',
        ensure => 'installed',
      } 

      Desired Behavior:
      I expect the code to display a list of packages for deletion when run with the --noop flag.

      Actual Behavior:
      The catalog fails to compile with following error when I use my example manifest:

      Error: Failed to apply catalog: Cannot alias Package[sl] to [nil, "sl", :yum]; resource ["Package", nil, "sl", :yum] already declared (file: /root/example.pp, line: 2)
      

      Examples:

      # example.pp
      # This causes errors because $title != $name
      package {'waste-of-time':
        name => 'sl',
        ensure => 'installed',
      }
       
      resources {'package':
        purge => true,
      }
      

      Run puppet apply --noop example.pp to see this error yourself. PLEASE BE CAREFUL AND ENSURE NOOP.

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              meyersh Shaun
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support