Ask Your Question
1

External facts not available in hiera.yaml?

asked 2013-11-23 07:12:55 -0500

Thynan gravatar image

Hi,

I want to use an external facter fact in my hiera hierarchy, to classify agent nodes into groups. I know this question has been discussed already, but I can't get it to work.

I defined an external fact in my agent node at /etc/facter/facts.d called "profile", with the value "someprofile".

At my puppetmaster i edited my hierarchy to look like this:

:hierarchy:
  - "node/%{::fqdn}"
  - "profile/%{::profile}"
  - common

In my /etc/puppet/hiera/profile/ folder I put a yaml file called "someprofile.yaml" with some data in it.

However, hiera doesn't find the data from ... (more)

edit retag flag offensive close merge delete

Comments

Hi! Good tip - I was only testing hiera from the command line. I did a puppet run later, and it worked as expected. I was kinda mislead, because an earlier ...(more)

Thynan gravatar imageThynan ( 2013-11-24 07:39:29 -0500 )edit

Do you know why hiera from the console doesn't work as expected, but puppet does?

Thynan gravatar imageThynan ( 2013-11-24 07:40:01 -0500 )edit
1

Hiera doesn't integrate with facter at all, so it doesn't load the facts. Hiera does have a -p flag, which might load the facter facts though. Would you ...(more)

Ancillas gravatar imageAncillas ( 2013-11-24 18:00:54 -0500 )edit

Thanks for the explanation - it completely makes sense now. :) However, I don't find an option to mark your comment as answer. I can only upvote it, and convert my ...(more)

Thynan gravatar imageThynan ( 2013-11-25 02:51:23 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-11-23 18:42:27 -0500

Ancillas gravatar image

updated 2013-11-29 01:13:49 -0500

Are you testing in a Puppet run, or are you running hiera on the command line? Hiera on the command line won't have access to facter facts.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-11-23 07:12:55 -0500

Seen: 541 times

Last updated: Nov 29 '13