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

classes do not honor refresh events when running with tags

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • PUP 4.9.1, PUP 4.9.2, PUP 4.9.3
    • PUP 4.10.9, PUP 5.3.3
    • None
    • CentOS 7, Puppet 4.9.3

    • Hide

      In the above example when running with --tags and notifying an included class, I believe the class should inherit the same tags its resources do, and trigger the Exec[notify test] in this case.

      Show
      In the above example when running with --tags and notifying an included class, I believe the class should inherit the same tags its resources do, and trigger the Exec [notify test] in this case.
    • Platform Core
    • 1
    • Platform Core KANBAN
    • Normal
    • 1 - 1-5% of Customers
    • 3 - Serious
    • 4 - $$$$$
    • While tags are not widely used there are a number of customers who rely on them for their specific workflow. We should either fix them to work as expected or make a decision on the future of them.
    • Bug Fix
    • With this change, refresh events are now correctly propagated to all tagged resources when running with tags, and some confusing debug and warning messages have been eliminated.
    • No Action
    • There is a automated test and Maggie has already done the testing that I would

    Description

      It appears that classes are not inheriting tags properly when included, but their resources are. This breaks notifying a class when running with --tags, and results in the relevant resources not getting the notify.

      tagsbug.pp:

      class foo {
        exec { 'notify test':
          command     => '/bin/true',
          refreshonly => true,
        }
      }
       
      class test {
        include foo
       
        exec { 'test':
          command => '/bin/true',
          #notify  => Class['foo'],
          notify  => Exec['notify test'],
        }
      }
       
      include test
       
      
      

      Running: puppet apply --test --tags test tagsbug.pp

      With Exec['test'] notifying Exec['notify test']:

      Info: Applying configuration version '1488579119'
      Notice: /Stage[main]/Test/Exec[test]/returns: executed successfully
      Info: /Stage[main]/Test/Exec[test]: Scheduling refresh of Exec[notify test]
      Notice: /Stage[main]/Foo/Exec[notify test]: Triggered 'refresh' from 1 events
      Info: Class[Foo]: Unscheduling all events on Class[Foo]
      Info: Stage[main]: Unscheduling all events on Stage[main]
      

      With Exec['test'] notifying Class['foo']:

      Info: Applying configuration version '1488579147'
      Notice: /Stage[main]/Test/Exec[test]/returns: executed successfully
      Info: /Stage[main]/Test/Exec[test]: Scheduling refresh of Class[Foo]
      Info: Class[Foo]: Unscheduling all events on Class[Foo]
      Info: Stage[main]: Unscheduling all events on Stage[main]
      

      Exec['notify test'] does not get notified/run. Looking at the --debug output:

      Debug: Class[Foo]: Not tagged with test
      Debug: Class[Foo]: Resource is being skipped, unscheduling all events
      

      Is this expected behavior? I even tried replacing 'include foo' with:

       class { 'foo':
         tag => 'test',
       }
      

      but the behavior of sending a notify to Class['foo'] is the same (it
      does not trigger Exec['notify test']).

      Notes

      Attachments

        Issue Links

          Activity

            People

              maggie Maggie Dreyer
              fetep Pete Fritchman
              Eric Delaney Eric Delaney
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support