簡體   English   中英

運行“ puppet agent -t”命令時出現人偶企業錯誤,無法從hieara獲取用戶/組數據

[英]Puppet enterprise error while running “puppet agent -t” commnad, unable to get User/Group data from hieara

我在Virtualbox上運行的VM上安裝了Puppet Enterprise。

安裝進行得很好,但是當我嘗試運行命令puppet agent -t ,出現以下錯誤:

[root@puppetmaster ~]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Could not find data item role in any Hiera data file and no default supplied at /etc/puppetlabs/code/environments/production/manifests/site.pp:32:10 on node puppetmaster.localdomain
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

這是我的site.pp文件行,錯誤來自哪里;

## site.pp ##

# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point
# used when an agent connects to a master and asks for an updated configuration.
#
# Global objects like filebuckets and resource defaults should go in this file,
# as should the default node definition. (The default node can be omitted
# if you use the console and don't define any other nodes in site.pp. See
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
# node definitions.)

## Active Configurations ##

# Disable filebucket by default for all File resources:
#http://docs.puppetlabs.com/pe/latest/release_notes.html#filebucket-resource-no-longer-created-by-default
File { backup => false }

# DEFAULT NODE
# Node definitions in this file are merged with node data from the console. See
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on
# node definitions.

# The default node definition matches any node lacking a more specific node
# definition. If there are no other nodes in this file, classes declared here
# will be included in every node's catalog, *in addition* to any classes
# specified in the console for that node.

node default {
 # This is where you can declare classes for all nodes.
 # Example:
 #   class { 'my_class': }
 $role = hiera('role')
 $location = hiera('location')
 notify{"in the top level site.pp : role is '${role}', location is '${location}'": }
 include "::roles::${role}"
}

如果你看一下錯誤,它不能找到你是否在為你的hiera關鍵site.pp

Could not find data item role in any Hiera data file and no default supplied at /etc/puppetlabs/code/environments/production/manifests/site.pp:32:10 on node puppetmaster.localdomain

在代碼中,您具有以下內容:

$role = hiera('role')
$location = hiera('location')

這兩個都是hiera調用,要求設置hiera,並且相關密鑰在hieradata文件夾中。

一個有用的工具來幫助你診斷hiera問題是hiera_explain ,這表明你你hiera層次是如何設置和配置,並可能有助於解釋的問題是與你的代碼是什么。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM