Ask Your Question
0

Understanding custom facts

asked 2015-10-27 05:54:12 -0500

Ath gravatar image

Hi,

I am getting bit confused about the custom facts.

I have 2 systems at different locations and I have created a custom fact to be assigned to one of them in a module which is assigned to one system.

Example: I have a system in Boston and London.

I have assigned a module to system in Boston and added the custom fact in that module.

After the puppet agent run, i see the fact present in Both the systems.

Is it by design ?

In that case, I need to access an exiting fact which is different on both, like a Node name prefix and then assign the fact accordingly ?

Best Regards,

Ath

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-10-27 11:27:54 -0500

GregLarkin gravatar image

If you add a custom fact to a module, it will be automatically downloaded to all agents whether or not the module itself is classified to the agent.

It's completely up to you to determine whether it makes sense for the custom fact to have a usable value on each agent node or not. Custom facts have various builtins (i.e. confine and perhaps others) to help you limit when a custom fact computes a value or not.

See: https://docs.puppetlabs.com/facter/3.0/custom_facts.html#configuring-facts

edit flag offensive delete link more

Comments

Thanks a Lot for the answer.

Ath gravatar imageAth ( 2015-10-27 11:38:11 -0500 )edit

Glad it helped!

GregLarkin gravatar imageGregLarkin ( 2015-10-27 15:05:12 -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

1 follower

Stats

Asked: 2015-10-27 05:54:12 -0500

Seen: 67 times

Last updated: Oct 27 '15