Ask Your Question

How to update puppet config [pluginsync = true] on agent nodes

asked 2015-09-07 16:22:35 -0600

udaysagar gravatar image

updated 2015-09-07 20:35:06 -0600


I have 15 puppet agents and 1 puppet master. I want to enable pluginsync = true on puppet agents for my new module to get the custom facts from the puppet master.

One way to enable pluginsync is doing it manually on each puppet agent by editing puppet.conf file. Is there any easy way or single step to do this task? I have searched for it but did not find any solution on the internet.


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-09-08 07:23:33 -0600

johnnyb04 gravatar image

updated 2015-09-08 07:27:22 -0600

First of all if your agents are running Puppet 3.0.0+, pluginsync is already enabled by default.

If you're running an older version, you could do this a couple of ways. First you could add your default puppet.conf file to your Puppet master under a new module for maintaining the configuration (e.g. /etc/puppet/modules/{new module}/files/puppet.conf). Just add the "pluginsync = true" to this file and then set each node to use this new module in your nodes/site file. You'll want to create an init.pp file for this new module. Your module class would look something like this...

class puppet_conf {
  file { 'puppet-conf-file':
    ensure => present,
    source => "puppet:///modules/puppet_conf/puppet.conf";
    #Best practice should also include a notify command here to update your puppet service.

Here's a different way to do it. You could setup an exec resource in a new module that checks to see if pluginsync is enabled in the puppet.conf file. If it's not, it will set it. The exec resource would look something like this under your new class.

exec { 'sed -e \$apluginsync\ \=\ true" /etc/puppet/puppet.conf':
#Only if the word pluginsync is not present  
onlyif => "test `grep 'pluginsync' /etc/puppet/pupp.conf | wc -l` -eq 0";
} #Note: This does take into consideration that pluginsync might = false
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


Asked: 2015-09-07 16:22:35 -0600

Seen: 1,857 times

Last updated: Sep 08 '15