0

I know using procedural steps in Puppet is generally frowned upon, but since we are using it to deploy Veritas-managed clustered applications, there is a specific set of steps that must happen before the rpm install is called.

Currently, we manually freeze the Veritas cluster so it doesn't try to failover the application, run Puppet, which installs the RPM (bringing the application down if necessary), and Puppet is instructed not to start the application. We then manually start the application and unfreeze Veritas. Finally, we verify the status.

I would like to automate those Veritas steps, so that we only have to run Puppet. These steps are only done in our production environment. For all others, we just need to call the RPM install. To complicate matters, I don't want to do any of these steps if nothing has changed.

What is the preferred way to do something like this? I was reading about Run Stages, but it seems like it would require a significant refactor of my existing code.

Wondering if someone could give me some ideas on how to handle this.

bdetweiler
  • 137
  • 5

1 Answers1

1

Based on your description of the problem you either need to use plans or throw everything into an exec or script so you can specify the order of things. Puppet manifests as they are aren't equipped to handle your use case.

An example would be:


exec { 'do veritas upgrade' :
  onlyif => '${lookup(veritas_version)} is greater than /usr/bin/veritas --version',
  exec => 'freeze && stop && install && start && unfreeze && verify',
}
Mike Marseglia
  • 883
  • 7
  • 18
  • To be clear, veritas is just managing the application cluster, the application is what is changing. But I think you're probably right, I know this is kind of a square peg/round hole problem. I will take a look at Plans though! That might be more appropriate for my scenario. – bdetweiler Jan 21 '20 at 21:06