简体   繁体   English

运行“ puppet agent -t”命令时出现人偶企业错误,无法从hieara获取用户/组数据

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

I have Puppet enterprise installed on my VM, running in Virtualbox. 我在Virtualbox上运行的VM上安装了Puppet Enterprise。

The installation went fine, but when I try to run the command puppet agent -t I get the following error: 安装进行得很好,但是当我尝试运行命令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

Here is my site.pp file line where the error is coming from; 这是我的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}"
}

If you look at the error, it can't find the hiera key that you've asked for in your site.pp : 如果你看一下错误,它不能找到你是否在为你的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

In your code, you have the following: 在代码中,您具有以下内容:

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

Both of these are hiera calls, that require that hiera is setup and that the relevant key is in a hieradata folder. 这两个都是hiera调用,要求设置hiera,并且相关密钥在hieradata文件夹中。

A useful tool to help you diagnose hiera issues is hiera_explain , which shows you how your hiera hierarchy is setup and configured, and might help explain what the issue is with your code. 一个有用的工具来帮助你诊断hiera问题是hiera_explain ,这表明你你hiera层次是如何设置和配置,并可能有助于解释的问题是与你的代码是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM