Ask Your Question

node lost his custom facters

asked 2013-11-21 03:44:00 -0600

shyp gravatar image

Hi , once in a while I see that some of my nodes are losing some of the environments variable and considering that some of the factor are missing :

the way I am defining the facter are in /etc/profile.d/

all the defaults facters are always there , the problem is with the one that I am adding in /etc/profile.d/

any reason why ?

should I define the facter in other way ?

edit retag flag offensive close merge delete


Could you post the exact code how you retrieve the factors from and what version of factor are you using ?

golja gravatar imagegolja ( 2013-11-21 08:34:42 -0600 )edit

file content : cat /etc/profile.d/ export FACTER_server_tags="role:napi_server_role=true,role:zabbix_agent=true" export FACTER_environment="qa" facter -v 1.7.3

shyp gravatar imageshyp ( 2013-11-21 09:47:22 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2013-11-25 14:57:05 -0600

Stefan gravatar image

Do you run the puppet agent as a service? The /etc/profile.d scripts are sourced at login, not at startup so if a machine reboots, your puppet agent will "loose" the custom facts.

edit flag offensive delete link more


no reboot was involved in the system , I think it comes after forcing running from command line puppet agent --test , but I am not sure . I am going to try ...(more)

shyp gravatar imageshyp ( 2013-11-26 09:15:04 -0600 )edit

answered 2013-11-26 04:23:10 -0600

facter 1.7 includes the possibility to make use of facts.d (/etc/facter/facts.d/) Within facts.d you caqn add yaml, json or text files with key value list. e.g. /etc/facter/facts.d/file.txt

servertags="role:napiserverrole=true,role:zabbixagent=true" environment="qa"

you can tests your facts on the node using

facter -p

Note: yaml files must use fileending .yaml, json files must use fileending .json, text files mus use fileending .txt

edit flag offensive delete link more


Hi , thanks for the comments : Do I need to make additional change besides adding the factes dir ? root@test:/etc/facter/facts.d# facter -v 1.7.3 root@test ...(more)

shyp gravatar imageshyp ( 2013-11-26 10:47:06 -0600 )edit

file naming (ending) is important!! rename your file from facts to facts.txt And: maybe remove the quotation marks.

Martin Alfke gravatar imageMartin Alfke ( 2013-11-26 11:26:02 -0600 )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


Asked: 2013-11-21 03:44:00 -0600

Seen: 205 times

Last updated: Nov 26 '13