On Thu, 2014-01-23 at 08:26 -0800, Krist van Besien wrote: > > > > Basically my situation is the following: > - A database server > - Several web application servers. > > The whole managed using foreman/puppet > > My Web applications each need a database, so I would like to just > export on the web application nodes the databases I need, and collect > them on the database server. However, several nodes that run the same > web application of course need the same database. What do I do when I > have two nodes, that both need the same database? > The logical, intuitive solution would be to export it on all of them, > but only collect it once on the database server. > > Other situations are : backends to a loadbalancer that export both > frontend and backend URLs. The loadbalancer collects both, and creates > it's configuration based on them. > > Krist
We have something quite similar - as we use hiera extensively we managed to have a common yaml file with a list of databases in a hash, and used create_resources to create the databases (and users, and haproxy listeners) on the database/haproxy nodes. The application nodes that want to register with a load balancer export resources for themselves only, which are collected on the load balancer only. An alternative is to have a manifest that ensures there is a suitable database available, creating it if not, running on the web application servers - you've got a db client there already which should be able to access the db server. That approach also allows you to ensure there's a database created before attempting to populate it and start the app, exported resources mean you'll need several runs before everything is clean. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/1390501547.11665.13.camel%40debian.my.home. For more options, visit https://groups.google.com/groups/opt_out.