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

Update documentation to reflect that Resource defaults since 5.0 depends on evaluation-order

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • PUP 6.0.4
    • None
    • Compiler, Docs
    • None
    • Needs Assessment
    • Needs Assessment

    Description

      *Puppet Version: 6.0.4
      *Puppet Server Version: n/a
      *OS Name/Version: CentOS 7.

      From the docs:

      Resource defaults are evaluation-order independent — that is, a default affects resource declarations written both above and below it.

      This is no longer the case since release 4.10.5.

      Desired Behavior:

      puppet apply the following manifest:

      file{'/tmp/junk.txt':
        ensure => present,
        content => "junk\n",
      }
       
      File{
         mode => '0777',
      }
      

      This should result in a file with mode '0777'.

      Running with puppet 4.9.4:

      Notice: /Stage[main]/Main/File[/tmp/file.txt]/ensure: defined content as '{md5}477fbe8ae54fcb5effa415227ec05cb4'
      Notice: Applied catalog in 0.07 seconds
      -rwxrwxrwx. 1 straylen c3 13 Dec  6 20:36 /tmp/file.txt
      

      Actual Behavior:

      Running with current HEAD 6.0.4+

      rm /tmp/file.txt && bundle exec  puppet apply ~/tmp/apply.pp && ls -l /tmp/file.txt
      Notice: Compiled catalog for aiadm83.cern.ch in environment production in 0.05 seconds
      Notice: /Stage[main]/Main/File[/tmp/file.txt]/ensure: defined content as '{md5}477fbe8ae54fcb5effa415227ec05cb4'
      Notice: Applied catalog in 0.32 seconds
      -rw-r--r--. 1 straylen c3 13 Dec  6 20:35 /tmp/file.txt
      

      The file is not '0777' as the defaults were never applied.

      Running a git bisect the patch that introduced this behaviour is

      https://github.com/puppetlabs/puppet/commit/38413cd78c61fe34d2ee343ef773a07b4786f65a

      Note the same behaviour is observed in both a simple manifest like above or if
      global default parameters are attempted via the site.pp file.

      Attachments

        Activity

          People

            jean Jean Bond
            traylenator Steve Traylen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support