Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
PUP 4.9.1, PUP 4.9.2, PUP 4.9.3
-
None
-
CentOS 7, Puppet 4.9.3
-
-
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
- Initial guess was that this was due to use of `include` instead of `contain` but it was determined that `contain`ed classes also fail to properly refresh events
- Internally, classes (containers) are replaced in the graph with whit "resources" (see https://github.com/puppetlabs/puppet/blob/ebd96213cab43bb2a8071b7ac0206c3ed0be8e58/lib/puppet/graph/relationship_graph.rb#L230-L273)
- it's possible tags are not correctly being propagated or evaluated to these resources