我正在尝试将脚本部署到代理并每小时使用 cron 运行该脚本。当我运行时,puppet agent -t
我收到错误:
服务器上的错误 400:Cron[homebackup] 上的参数路径无效,位于节点上的 /etc/puppet/modules/homebackup/manifests/init.pp:16
在清单中我在路径中写入:(/etc/puppet/modules/homebackup/manifests/init.pp
位于/etc/puppet/modules/homebackup/script.sh
puppet master上)
class homebackup {
file { 'scriptfile':
ensure => 'file',
source => 'puppet:///modules/homebackup/script.sh',
path => '/usr/local/bin/script.sh',
owner => 'root',
group => 'root',
mode => 0755,
}
cron { 'homebackup':
ensure => 'present',
command => "/usr/local/bin/script.sh",
user => root,
minute => 0,
require => File['scriptfile'],
}
}
有人可以帮我找到故障吗?
这是固定清单
class homebackup {
file { 'scriptfile':
ensure => 'file',
source => 'puppet:///modules/homebackup/script.sh',
path => '/usr/local/bin/script.sh',
owner => 'root',
group => 'root',
mode => 0755,
}
cron { 'homebackup':
ensure => 'present',
command => "/usr/local/bin/script.sh",
user => root,
hour => "23",
minute => absent,
require => File['scriptfile'],
}
}