What would be the preferred way to update the configuration of one node when provisioning new nodes?

E.g. let's say there is a cluster-like environment

i am provisioning nodes, let's say these nodes need to access a memcached or MySQL Server on some other node (also managed by puppet)

now when adding a new node, how do i go about updating iptables configuration or any other initial configuration step that is needed on another node in order to enable the new node to start its job?

i am using a homegrown "provisioning" system for these tasks currently, is there a convenient way to use puppet for something like this?


It's not particularly simple, but it is possible using standard Puppet resources.

For configurations like firewall rules and monitoring, you can quite easily use exported resources in conjunction with a storedconfigs back-end such as PuppetDB.

The idea behind exported resources is that when the Puppet manifest is run on the target node, it 'exports' some resources and stores them. You can configure other nodes to collect these resources and apply them in their own manifests.

For other configurations, you may need to be more clever and use the concat module in addition to exported resources - for example you can theoretically use an exported concat::fragment resource and collect those resources where you want the information - e.g. database credentials or load balancer IPs.


This isn't well supported by Puppet. To get this sort of information you can query PuppetDB. Puppet doesn't include the ability to do this itself as far as I know, but puppet-puppetdbquery adds that. Here's a tutorial on putting the two together to generate a a configuration file with data from PuppetDB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.