2016-12-28 6 views
0

У меня есть предприятие Puppet, установленное на моей виртуальной машине, работающее в Virtualbox.Ошибка кукольного предприятия во время работы «кукольный агент -t» commnad, неспособный получить данные пользователя/группы от hieara

Установка прошла нормально, но когда я пытаюсь запустить команду puppet agent -t я получаю следующее сообщение об ошибке:

[[email protected] ~]# 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}" 
} 
+0

Необходимо, чтобы в вашей иерархической иерархии был ключ 'role 'где-то со значением. –

ответ

1

Если посмотреть на ошибки, он не может найти ключ 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, в котором показано, как настроена и настроена иерархия вашей иерархии, и может помочь объяснить, в чем проблема с вашим кодом.