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?
-
1Welcome, Andriy! I've visited Lviv several times - it is a delightful city.– EEAAJan 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?– ZoredacheJan 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.– Andrii YurchukJan 31, 2013 at 4:09
-
But why must the master be aware of those changes?– turingmachineFeb 1, 2013 at 17:57
-
And the master then does what with that information, exactly?– jgoldschrafeFeb 3, 2013 at 6:19
2 Answers
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.
-
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.– lsdFeb 1, 2013 at 19:02
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,
}