【发布时间】:2019-02-26 23:20:48
【问题描述】:
在厨房聚合期间,调用 puppet 应用,我收到此错误:
Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::alibi for ... at .. entry.pp
alibi 是模块名称,并且:
/tmp/kitchen>ll
total 8
drwxrwxr-x. 4 kitchen kitchen 80 Feb 26 14:14 hiera
-rw-rw-r--. 1 kitchen kitchen 170 Feb 26 14:14 hiera.global.yaml
drwxrwxr-x. 2 kitchen kitchen 100 Feb 26 14:35 manifests
drwxrwxr-x. 4 kitchen kitchen 80 Feb 26 14:14 modules
-rw-rw-r--. 1 kitchen kitchen 901 Feb 26 13:53 puppet.conf
/tmp/kitchen>more manifests/entry.pp manifests/init.pp
::::::::::::::
manifests/entry.pp
::::::::::::::
hiera_include('classes')
::::::::::::::
manifests/init.pp
::::::::::::::
class alibi () {
$instances = hiera_hash("alibi::instances", {})
validate_hash($instances)
create_resources("alibi::instance", $instances)
}
/tmp/kitchen>/tmp/kitchen>more hiera.global.yaml
---
:backends:
- yaml
:yaml:
:datadir: "/tmp/kitchen/hiera"
:hierarchy:
- tests/%{hostname}
- origin/main
# options are native, deep, deeper
:merge_behavior: deeper
/tmp/kitchen>/tmp/kitchen>more hiera/origin/main.yaml
classes:
- alibi
命令是
export MANIFESTDIR='/tmp/kitchen/manifests'; sudo -E env
http_proxy=http://proxy-internet.localnet:3128
https_proxy=http://proxy-internet.localnet:3128 puppet apply
/tmp/kitchen/manifests/entry.pp --modulepath=/tmp/kitchen/modules
--fileserverconfig=/tmp/kitchen/fileserver.conf
--hiera_config=/tmp/kitchen/hiera.global.yaml --detailed-exitcodes -v
如果我使用 init.pp 而不是 entry.pp 就可以(但不调用 hiera_include())
【问题讨论】:
标签: puppet test-kitchen hiera