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

require => Exec does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.5.1
    • Fix Version/s: PUP 3.5.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux

    • Template:

      Description

      Puppet 3.5.1 resources types File and Notify cannot successfully require an Exec. The File or Notified are applied no matter whether the Exec is applied or not:

              exec { "test" :                                                                             
                  path => "/bin:/sbin:/usr/bin:/usr/sbin",
                  command => "/bin/true",
                  onlyif => "test -e /etc/",
              }
       
              notify { "test executed" :
                  require => Exec["test"],
              }
      

      Produces output:

      Info: Applying configuration version '1402419467'
      Notice: /Stage[main]/Desktops/Exec[test]/returns: executed successfully
      Notice: test executed
      Notice: /Stage[main]/Desktops/Notify[test executed]/message: defined 'message' as 'test executed'
      Notice: Finished catalog run in 4.14 seconds
      

      That is OK.

      This code

              exec { "test" :  
                  path => "/bin:/sbin:/usr/bin:/usr/sbin",
                  command => "/bin/true",
                  onlyif => "test -e /doesnotexist",
              }
       
              notify { "test executed" :
                  require => Exec["test"],
              }
      

      produces this output:

      Info: Applying configuration version '1402419552'
      Notice: test executed
      Notice: /Stage[main]/Desktops/Notify[test executed]/message: defined 'message' as 'test executed'
      Notice: Finished catalog run in 4.02 seconds
      

      Notify applied even though Exec is not!

      In both cases notify is applied, but in one Exec is applied and the other Exec is not, even though the notify requires the Exec.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              cwseys c sights
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support