Ask Your Question

Unable to run the script in cron via manifest

asked 2015-06-21 12:41:12 -0600

goodtoddy gravatar image

I am trying to deploy a script to agents and run the script using cron every hour. When I am running "puppet agent -t" I am getting error: Error 400 on SERVER: Invalid parameter path on Cron[homebackup] at /etc/puppet/modules/homebackup/manifests/init.pp:16 on node

In master file: I have script in /etc/puppet/modules/homebackup/ Manifest I wrote in path : /etc/puppet/modules/homebackup/manifests/init.pp

class homebackup {
file { 'script file':
  ensure => 'file',
  source => 'puppet:///modules/homebackup/',
  path => '/usr/local/bin/',
  owner => 'root',
  group => 'root',
  mode => 0755,

cron { 'homebackup':
  path => "/etc/cron.d/script.cron",
  ensure => 'present',
  minute => '0',
  require => File["/puppet/"],

could someone help me in finding the glitch?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2015-06-21 19:16:36 -0600

csharpsteen gravatar image

An "invalid parameter" error indicates that you have specified a parameter in a resource declaration that is not supported by the Type. Looking up the Cron resource in Type Reference reveals the list of supported parameters:

cron { 'resource title':
  name        => # (namevar) The symbolic name of the cron job.  This name is 
  ensure      => # The basic property that the resource should be...
  command     => # The command to execute in the cron job.  The...
  environment => # Any environment settings associated with this...
  hour        => # The hour at which to run the cron job. Optional; 
  minute      => # The minute at which to run the cron job...
  month       => # The month of the year.  Optional; if specified...
  monthday    => # The day of the month on which to run the...
  provider    => # The specific backend to use for this `cron...
  special     => # A special value such as 'reboot' or 'annually'...
  target      => # The name of the crontab file in which the cron...
  user        => # The user who owns the cron job.  This user must...
  weekday     => # The weekday on which to run the command...
  # any applicable metaparameters.

There is no path parameter in that list, but target may be what you are looking for.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-06-21 12:39:57 -0600

Seen: 908 times

Last updated: Jun 21 '15