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

Virtual Collector overrides fail with in 5.x

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 5.3.5
    • Fix Version/s: PUP 5.5.z
    • Component/s: Language
    • Labels:
    • Environment:

      Puppet 5.3.5 with virtual resources and collector overrides. 

    • Template:
      PUP Bug Template
    • Sub-team:
    • Team:
      Froyo
    • Sprint:
      Platform Core Grooming
    • Method Found:
      Customer Feedback
    • CS Priority:
      Reviewed

      Description

      In Puppet 4.x one could use a resource collector to override parameters of a file resource, but this is no longer working in 5.x. The failure occurs when there is a resource default in the manifest with the virtual resource and a collector override that specifies the same value.

      Below are example manifests that cause the failure.

       

      # cat manifests/init.pp
      class test {
          File {
            ensure   => directory,
            owner    => '0',
            group    => '0',
            mode     => '0755',
          }
       
        @file { '/tmp/testing':
          owner => '0',
          group => '0',
          mode  => '0750',
        }
      } 

       

      # cat manifests/realize.pp
      class test::realize {
        require test
         File <| title == '/tmp/testing' |> { mode => '0755' }
      } 

       

      The result of the example above is that the mode of the file is `0750` instead of the expected `0755`.

      drwxr-x---  2 root  root  68 May 16 13:57 /tmp/testing 

       

      When there is no default file resource in the example above, the override works correctly:

      # cat manifests/init.pp
      class test {
       
        @file { '/tmp/testing':
          ensure => directory,
          owner => '0',
          group => '0',
          mode  => '0750',
        }
      } 
      # cat manifests/realize.pp
      class test::realize {
        require test
         File <| title == '/tmp/testing' |> { mode => '0755' }
      }

      The result is a file with `0755` permissions. 

      drwxr-xr-x 2 root root 68 May 16 13:59 /tmp/testing  

      This behavior was not seen with Puppet 4.x, so it appears to be a regression in 5.x. 

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            jarret.lavallee Jarret Lavallee
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support