file directory with recurse and tags

96 views
Skip to first unread message

Aaron Russell

unread,
Dec 29, 2015, 3:00:29 PM12/29/15
to Puppet Users
When using notify to restart a service after a directory sync (File resource with recurse) and tags the service never restarts. 
I tried to look through the puppet bugs but could not find any. 
Does anyone have any ideas?

Code i tested with. 
class test {
  tag 'blue'
   
    file { "/tmp/foo":
      ensure   => directory,
      recurse  => true,
      source   => 'puppet:///modules/test',
      notify   => Service["bluetooth"],
    }
    service { 'bluetooth' :
      ensure    => running,
    }
}
include test


Using either --tags test or --tags blue also tried --tags blue,test the service Bluetooth wont restart. 

Here is a snippet of debug log
Debug: Caching environment 'production' (ttl = 0 sec)
Notice: /Stage[main]/Test/File[/tmp/foo]/ensure: current_value absent, should be directory (noop)
Debug: /Stage[main]/Test/File[/tmp/foo]: The container /tmp/foo will propagate my refresh event
Notice: /Stage[main]/Test/File[/tmp/foo/test]/ensure: current_value absent, should be directory (noop)
Debug: /Stage[main]/Test/File[/tmp/foo/test]: The container /tmp/foo will propagate my refresh event
Notice: /Stage[main]/Test/File[/tmp/foo/test/one]/ensure: current_value absent, should be file (noop)
Debug: /Stage[main]/Test/File[/tmp/foo/test/one]: The container /tmp/foo will propagate my refresh event
Debug: /tmp/foo: Not tagged with blue
Debug: /tmp/foo: Resource is being skipped, unscheduling all events
Info: /tmp/foo: Unscheduling all events on /tmp/foo
Debug: Executing: '/usr/bin/systemctl is-active bluetooth'
Debug: Class[Test]: Not tagged with blue
Debug: Class[Test]: Resource is being skipped, unscheduling all events
Debug: Stage[main]: Not tagged with blue
Debug: Stage[main]: Resource is being skipped, unscheduling all events

Aaron Russell

unread,
Dec 29, 2015, 3:03:21 PM12/29/15
to Puppet Users
Sorry here is my puppet version

4.3.1

jcbollinger

unread,
Jan 4, 2016, 9:48:23 AM1/4/16
to Puppet Users


Something is very strange here.  Leaving the File resource aside, this ...
class test {
  tag
'blue'
 
...
}



... is inconsistent with ...



Debug: Class[Test]: Not tagged with blue


My first guess would be that you have a caching issue, so that the master is not using the latest version of your class.  If you have configured a cache timeout for the environment in question then you can wait at least that long after changing any classes to ensure that the latest versions will be seen.  Whether you have configured a timeout or not performing a [graceful] server restart will definitely effect cache clearing.


John

Reply all
Reply to author
Forward
0 new messages