Ask Your Question
0

hiera_include('classes') not working in puppet 3.8

asked 2015-10-15 06:58:32 -0500

Chutki gravatar image

Hi,

I installed puppet 3.8 and used "hiera_include('classes')", but getting below error.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find data item classes in any Hiera data file and no default supplied at /etc/puppetlabs/puppet/environments/production/manifests/site.pp:44 on node

below is site.pp file

  /etc/puppetlabs/puppet/environments/production/manifests/site.pp

    hiera_include('classes')

hiera.yaml file

etc/environments/production/hiera.yaml
---
:backends:
  - yaml
:hierarchy:
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global
  - 'hieradata/common'
:yaml:

  :datadir: '/etc/puppetlabs/puppet'

Below is the maifests

/etc/puppetlabs/puppet/environments/production/modules/test.pp

class test{

notify {'Hi':}
}
include test

"puppet agent -t" compiling catalog without any error if I don't include "hiera_include('classes')" in site.pp

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-15 10:18:49 -0500

lupin gravatar image

updated 2015-10-15 10:22:47 -0500

Have you created the actual hiera data file that contain your classes? E.g.

on file

/etc/puppetlabs/puppet/defaults.yaml
---
classes:
  - test

By the way, here's the link of relevant docs

edit flag offensive delete link more

Comments

yes. I created the actual yaml file /etc/puppetlabs/puppet/environments/production/hieradata/common.yaml --- classes: - test Also mentioned the details in hiera.yaml file

Chutki gravatar imageChutki ( 2015-10-15 11:29:35 -0500 )edit

Two things that you can check/verify. 1) hiera -d 'classes' on you puppet server 2) make sure your module has correct directory layout, with <module_name>/init.pp file.

lupin gravatar imagelupin ( 2015-10-15 13:38:36 -0500 )edit

Thanks. It worked.

Chutki gravatar imageChutki ( 2015-10-16 06:34:17 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2015-10-15 06:58:32 -0500

Seen: 728 times

Last updated: Oct 15 '15