Ask Your Question
0

can i change default_gateway.rb file without effecting anything in the file with same name but in different directory

asked 2017-06-29 06:40:39 -0600

kanchan gravatar image

there are two hirerchachy as shown /etc/puppet/environments/acceptance/modules/mobistar/lib/facter/defaultgateway.rb /etc/puppet/environments/production/modules/mobistar/lib/facter/defaultgateway.rb

I want to change something in (acceptance/modules/mobistar/lib/facter/default_gateway.rb) ...could you please assure it wil not effect anythng in production environment though both are in same server

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-06-29 07:07:05 -0600

kanchan gravatar image

ok thenks for such a quick response... i got an error [root@grice puppet]$puppet agent -t --environment acceptance Info: Retrieving pluginfacts Info: Retrieving plugin Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'evalgenerate': Error 400 on SERVER: Permission denied - /etc/puppet/environments/acceptance/modules/mobistar/lib/facter/kernelData.txt Info: Loading facts Error: Could not retrieve local facts: undefined method to_a' for "ens160":String Error: Failed to apply catalog: Could not retrieve local facts: undefined methodtoa' for "ens160":String

edit flag offensive delete link more
0

answered 2017-06-29 06:59:37 -0600

DarylW gravatar image

The custom facts in a module are what is sent from the server to the master during the 'modulesync' part of the client/server interaction.

If you wish to observe this in action, take an instance (not in production) and point it at the production environment, and do a puppet run ( sudo puppet agent -t --environment production ). You'll observe the 'modulesync' step, and it pulling down new versions of the custom facts. You can either note the md5sum that it shows, or find the fact on the file system and copy it somewhere.

Then, in your example environment, modify the fact that you wish to observe. You either could make it do something different (return a static string of 'I changed this' as it's value), or adjust the file. Then envoke the same call as above, and verify that it didn't list a change/update to the fact (while you are still pointing at the production environment). You can find the file, and either calculate the md5sum and see that it didn't change, or diff it against a copy of the file from earlier.

Now, do a call pointing at your example environment ( sudo puppet agent -t --environment example ), and you should observe the modified fact being updated during the 'modulesync' process. If you modified the output, running sudo facter -p mymodifiedfact should show you your changed output, or do like before and either compare md5's on the file, or diff it against the version you pulled back.

If you again call against production, you should see the fact revert to it's original form.

edit flag offensive delete link more

Comments

[root@grice puppet]$puppet agent -t --environment acceptance Error: /File[/var/lib/puppet/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Permission denied - /etc/puppet/environments/acceptance/modules/mobistar/lib/facter/kernelData.txt

kanchan gravatar imagekanchan ( 2017-06-29 07:07:59 -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

Stats

Asked: 2017-06-29 06:40:39 -0600

Seen: 20 times

Last updated: Jun 29