0

What are the possible ways to implement the following: if a config file is changed on Agent its new version should be pulled by Master from that Agent?

5
  • 1
    Welcome, Andriy! I've visited Lviv several times - it is a delightful city.
    – EEAA
    Jan 30, 2013 at 14:21
  • What exactly are you trying to do? Are you trying to use puppet to push configs from a particular system to many, or something else?
    – Zoredache
    Jan 30, 2013 at 17:26
  • @Zodecache I'm trying to keep the master aware of any changes that can occur in configuration on the agent. Jan 31, 2013 at 4:09
  • But why must the master be aware of those changes? Feb 1, 2013 at 17:57
  • And the master then does what with that information, exactly? Feb 3, 2013 at 6:19

2 Answers 2

0

This is the exact opposite of how Puppet is designed to work, so I think you're out of luck.

The closest you can get is likely to run a $ puppet agent -t --noop, which would show discrepancies between local config and the puppet manifests. At that point, though, it would be up to you to implement those changes within puppet.

1
  • Yeah, I wouldn't do it. I have a puppet module that manages the puppet config for all nodes, including the master. It is under version control, so the change can be done anywhere, then committed to the repo and pulled into the module tree on the master.
    – lsd
    Feb 1, 2013 at 19:02
0

If the file in question is already under puppet control (that is via file type), then you can just deploy that file also on the master.

If the the file is not under puppet control, one way to achive your goal would be to use the audit feature of puppet.

file{'/watch':
  replace => false, # don't change the content
  audit => content, # monitor for changes
  notify => Exec['sync_files'],
}
exec{'sync_files:
  command => 'rsync -a /watch puppetmaster:/destination/', 
  refreshonly => true,
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .