Ask Your Question
0

how to load custom facts in agent server for the first run

asked 2017-07-14 02:20:52 -0500

kanchan gravatar image

version of puppet server and puppet agent node is 3.6 and 3.8.4 respectively though facter is installed in both nodes(checked manually by running facter) My question is how to create custom facts from puppet master to agent node(i want to copy the ruby files from server to agent) Steps followed: created a .rb file in /var/lib/puppet/lib/facter/lastrunn.rb in master server set the value of pluginsync= true in both server as well as agent inside /etc/puppet/puppet.conf file facter -p lastrun [i npuppet master] --display the output in consle Also,inside /var/lib/puppet/yaml/facts/ a yaml file is generated for the host

but if i run puppet agent -t --pluginsync in agent node i can't see any file being created in /var/lib/puppet/lib/facter..no ruby files get copied

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-07-17 10:21:26 -0500

reesek gravatar image

You can distribute custom facts that are not module specific within your puppet-control's site directory, something like:

puppet-control/site/facts/lib/facter/lastrunn.rb

(there are two n's in the posted question, so I have two n's in "lastrunn" here)

Make sure the fact is in the proper environment in which you're looking to use this fact (perhaps all of them) and deploy. Subsequent puppet runs will plugin sync the fact, which should then be available via 'facter -p'. For additional context, see this reddit post.

edit flag offensive delete link more

Comments

hi,thenks a lot... the issue has been resolved...i managed to define .rb files in /etc/puppet/modules/mobistar/lib/facter/last_run.rb where mobistar is a custom module..and in site.pp file (i have included the class mobistar)...so now in agent server the facts are loaded...files get created and fact

kanchan gravatar imagekanchan ( 2017-07-18 00:21:39 -0500 )edit

facter -p last_run returns the output but i don't know why it did not work when in included the custom module inside environment directory thoughi chnaged the modulespath in puppet.conf

kanchan gravatar imagekanchan ( 2017-07-18 00:22:42 -0500 )edit
0

answered 2017-07-14 08:03:48 -0500

DarylW gravatar image

any custom facts that are a part of the modules in the environment that the client is using will be sent to the client via pluginsync. There is some basic set of facts that get synced from the master as well. Putting them in the master's facter location won't help with that.

edit flag offensive delete link more

Comments

ok ..right....and that is the reason i see a file inside /var/lib/puppet/yaml/facts/ in master server .... but if i want to create custom facts and pass it to agent server..how can i achieve that?

kanchan gravatar imagekanchan ( 2017-07-14 08:32:02 -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: 2017-07-14 02:20:52 -0500

Seen: 54 times

Last updated: Jul 17