Puppet Apply:找不到的类
这看起来很简单,它可以在Vagrant上工作,但我不能让它在EC2服务器上工作 当: 错误:Puppet Apply:找不到的类,puppet,configuration-management,Puppet,Configuration Management,这看起来很简单,它可以在Vagrant上工作,但我不能让它在EC2服务器上工作 当: 错误: Could not find class base for s1.ec2.internal at /var/lib/jenkins/jobs/s1/workspace/manifests/init.pp:1 on node s1.ec2.internal 文件/manifests/init.pp: include base class base { exec { "apt-get updat
Could not find class base for s1.ec2.internal at /var/lib/jenkins/jobs/s1/workspace/manifests/init.pp:1 on node s1.ec2.internal
文件/manifests/init.pp:
include base
class base {
exec { "apt-get update":
command => "/usr/bin/apt-get update",
timeout => 0
}
package { ["vim", "git", "build-essential"]:
ensure => present,
require => Exec["apt-get update"]
}
}
文件/manifests/base.pp:
include base
class base {
exec { "apt-get update":
command => "/usr/bin/apt-get update",
timeout => 0
}
package { ["vim", "git", "build-essential"]:
ensure => present,
require => Exec["apt-get update"]
}
}
Puppet v2.7.23通常只能在名为
base
的模块中找到classbase
尝试将其放入
modules/base/init.pp
而不是manifests/base.pp
中,就像Felix所说的那样,正在木偶清单的模块中查找类基。模块的目录结构如下所示:
$confdir/
|- manifests
|- init.pp <- The file you reference to when executing puppet apply
|- modules
|- base
|- manifests
|- init.pp <- The file containing your base class
$confdir/
|-显示
|-init.pp在我的例子中,这是一个权限问题-文件归root所有,但我没有使用sudo运行puppet
我要尝试一下。但是为什么它能在vagrant(native precise64 puppet)上工作呢?我试图将清单/base.pp
移动到清单/modules/base/init.pp,但没有工作。如上所述,模块
树必须与清单
处于同一级别,而不是在清单
内。Vagrant可能会根据某些具体情况在供应过程中工作,但在机器内部使用时,这些情况不会扩展到puppet apply
。