puppet repo的目录结构如下:
.
|-- data
| |-- common.yaml
|-- environment
| |-- environment.conf
| `-- hiera.yaml
|-- files
| `-- cdn
|-- hiera
| `-- hiera.yaml
|-- hiera.global.yaml
|-- manifests
| `-- site.pp
|-- modules
|
`-- site
|-- profile
| |-- files
| `-- manifests
| |-- appliance
| | |-- base.pp
`-- role
`-- manifests
|-- README.md
`-- role1
`-- appliance.pp
site.pp文件如下:
File { backup => false }
if $::custom_facts['appliance_type'] == 'Delivery' {
include role::role0::app
}
if $::custom_facts['appliance_type'] == 'Appliance' {
include role::role1::appliance **// line where error is occuring**
}
node default {
}
当我运行puppet apply命令时失败,出现以下错误:
Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::role::role1::appliance for default-puppetmaster-centos-7.vagrantup.com (file: /tmp/kitchen/manifests/site.pp, line: 9, column: 3) on node default-puppetmaster-centos-7.vagrantup.com
应用的puppet命令:
sudo -E /opt/puppetlabs/bin/puppet apply /tmp/kitchen/manifests/site.pp --modulepath=/tmp/kitchen/modules --fileserverconfig=/tmp/kitchen/fileserver.conf --environment=kitchen_vagrant_puppet --environmentpath=/etc/puppetlabs/code/environments --hiera_config=/tmp/kitchen/hiera.global.yaml
我搞不懂木偶为什么找不到这个班。类位于角色文件夹中。目录结构是否错误?
编辑:
添加的内容
envirnment.conf
文件:
modulepath = site:modules:$basemodulepath