看到以下错误Puppet 4
# /opt/puppetlabs/bin/puppet agent --verbose --no-daemonize --onetime
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for aus-lnaswgp-002.wiley.com
Error: Failed to apply catalog: Parameter unless failed on Exec[sh /home/agile/svncheckout.sh]: 'test -f /home/agile/subversion.done' is not qualified and no path was specified. Please qualify the command or specify a path. at /apps/wps/puppetlabs/code/environments/production/manifests/classes/subversion.pp:17
代码如下:
# cat /apps/wps/puppetlabs/code/environments/production/manifests/classes/subversion.pp
class subversion {
# A package for subversion install and necessary svn checkouts for user agile
package {'subversion':
ensure => installed,
}
file {'/home/agile/svncheckout.sh':
ensure => present,
group => agile,
mode => "755",
source => "puppet://puppet/scripts/svncheckout.sh",
require => [ Package['subversion'], Class['user_default'] ],
before => [Class['apache1'], Class['activemq'], Class['luciddb'], Class['sybase']],
}
看来脚本无法复制svncheckout.sh
。puppet/scripts/svncheckout.sh
有什么建议可以解决上述错误吗?
答案1
您发布的代码片段与输出的错误无关。
错误表明您需要限定命令的路径unless
,因此test
变成/usr/bin/test
(或test
系统上安装二进制文件的任何位置)。
使用which test
命令查找文件的完整路径,并相应地编辑代码。