我在snoopy模块上遇到错误。当我在客户端上运行它时,出现此错误:
“错误:无法从远程服务器检索目录:SERVER上的错误400:
Puppet :: Parser :: AST :: Resource失败,错误ArgumentError:在节点
的/etc/puppet/modules/snoopy/manifests/init.pp:22处找不到声明的类snoopy :: install 警告:在失败的目录上不使用缓存
错误:无法检索目录。跳过运行”
有什么主意我在这里做错了吗?这是git的snoopy模块,对我们的环境进行了一些修改。 https://forge.puppet.com/revolutionsystem/snoopy
install.pp
$ cat install.pp
# snoopy::install
#
# A description of what this class does
#
# @summary A short summary of the purpose of this class
#
# @example
# include snoopy::install
class snoopy::install {
# Download snoopy installation script
file { '/tmp/snoopy':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
} ->
exec { 'wget installer':
command => "/usr/bin/wget http://159.79.213.28/pub/PUPPET/snoopy- install.sh",
creates => "/tmp/snoopy/snoopy-install.sh",
require => [ File['/tmp/snoopy'], ];
} ->
# Install Snoopy stable version
exec { '/tmp/snoopy/snoopy-install.sh stable':
cwd => '/tmp/snoopy',
command => '',
path => [ '/bin/bash' ],
unless => [ 'test -f /tmp/snoopy/snoopy-install.sh']
require => [ File['/tmp/snoopy'], File['/tmp/snoopy/snoopy- install.sh'], ];
}
}'
$ cat init.pp
# snoopy
#
# A description of what this class does
#
# @summary A short summary of the purpose of this class
#
# @example
# include snoopy
class snoopy (
$user_name = $::snoopy::params::username,
$user_id = $::snoopy::params::userid,
$group_id = $::snoopy::params::groupid,
$super_id = $::snoopy::params::superid,
$terminal = $::snoopy::params::terminal,
$current_directory = $::snoopy::params::currentdirectory,
$process_id = $::snoopy::params::processid,
$file_name = $::snoopy::params::filename,
$log_file = $::snoopy::params::logfile,
$log_path = $::snoopy::params::logpath,
$date_time = $::snoopy::params::datetime
) inherits snoopy::params {
class { 'snoopy::install': }
class { 'snoopy::configure':
username => $user_name,
userid => $user_id,
groupid => $group_id,
superid => $super_id,
terminal => $terminal,
currentdirectory => $current_directory,
processid => $process_id,
filename => $file_name,
logfile => $log_file,
logpath => $log_path,
datetime => $date_time
}
}
可以将其关闭,这与我们正在运行的puppet agent的版本有关。模块所需的版本> = 4.0.0和<= 6.0.0。
我们正在运行3.8.x。