Hi,

I'm seeing the following error when running the agent on a server:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: 
Server Error: Could not find resource 'File[/etc/logrotate.d/syslog]' in 
parameter 'subscribe' (file: 
/etc/puppetlabs/code/environments/production/modules/base/manifests/syslog.pp, 
line: 21) on node lhcsrvmtrrsl01.fixnetix.com

I want the logrotate command to run every time there is a change to the 
/etc/logrotate.d/syslog file.  Thought this could be achieved via the 
following:

  exec { 'LogRotate':
    path        => '/usr/sbin',
    command     => 'logrotate -vdf /etc/logrotate.d/syslog 2>/dev/null',
    subscribe   => File['/etc/logrotate.d/syslog'],
    refreshonly => true,
  }

I can't work out why the agent is complaining re Could not find resource 
'File[/etc/logrotate.d/syslog]'

# puppet resource file /etc/logrotate.d/syslog
file { '/etc/logrotate.d/syslog':
  ensure   => 'file',
  content  => '{md5}e59f6816e9fcd21174501313720c660f',
  ctime    => '2019-10-22 21:36:25 +0100',
  group    => 0,
  mode     => '0644',
  mtime    => '2019-10-22 21:36:25 +0100',
  owner    => 0,
  selrange => 's0',
  selrole  => 'object_r',
  seltype  => 'etc_t',
  seluser  => 'system_u',
  type     => 'file',
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/482e3b96-c20c-4517-85c9-dc437f28c56c%40googlegroups.com.

Reply via email to