On Wednesday, November 14, 2012 3:49:20 PM UTC-6, Michael Hüttermann wrote:
Hello,
how do you include or link database updates to Puppet, respectively to states on target environments?
Given an application/infrastructure that also includes a database, updates on database structure and data must be distributed as well, whereas the version/state of application/infrastructure (distributed by Puppet) must match the version (structure/data) of a used database.
My first suggestion would be to use your native package management system as the delivery and accounting vehicle for your database updates. If you do that, then Puppet can just ensure that nodes have the correct / latest version of the appropriate package. Indeed, I would suggest that you package up the whole application / infrastructure. If you do package the whole kit & kaboodle then the package management system can enforce version matching for you, too.
If you want to manage your database updates more directly via Puppet, then you will first have to consider how you will determine whether a target database is already in sync. You will need a programmatic procedure to perform that evaluation, either as a shell script (for using an Exec to apply the updates) or as a Ruby method (for incorporation into the provider for a custom resource type). You will also need a programmatic procedure to apply the update when needed -- again, either a shell script or a Ruby method.
John