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

manifest ordering changes order with directory file types that recurse

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 3.6.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      all linux

    • Template:

      Description

      Manifest ordering produces some unexpected results when a file type is set to directory and recurse.

      Steps to reproduce:

      1. Create the following manifest on the system under test.

      class change_detection {
          exec { 'env':
            command => "/var/tmp/scripts/test.sh",
            user => 'root',
            require => File['/var/tmp/scripts/'],
          }
          file { '/var/tmp/scripts/':
              ensure => directory,
              recurse => true,
              source => "/etc/puppetlabs/puppet/modules/mymodule/scripts/",
          }
      }
       
      include change_detection
      

      ordering=title-hash always produces a run in this order:

      Notice: /Stage[main]/Change_detection/File[/var/tmp/scripts/]/ensure: created
      Notice: /Stage[main]/Change_detection/File[/var/tmp/scripts/test.sh]/ensure: defined content as '{md5}cb48391254b4647bf970e0918ff3e8a6'
      Notice: /Stage[main]/Change_detection/Exec[env]/returns: executed successfully
      

      ordering=manifest always produces a run in this order:

      Notice: /Stage[main]/Change_detection/File[/var/tmp/scripts/]/ensure: created
      Error: Could not find command '/var/tmp/scripts/test.sh'
      Error: /Stage[main]/Change_detection/Exec[env]/returns: change from notrun to 0 failed: Could not find command '/var/tmp/scripts/test.sh'
      Notice: /Stage[main]/Change_detection/File[/var/tmp/scripts/test.sh]/ensure: defined content as '{md5}cb48391254b4647bf970e0918ff3e8a6'
      

      Does title-hash work because those two File objects happily hash to something that precedes the exec? The behavior is very much related to PE-3049.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            tony.vu Tony Vu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support