How to model a sequence of steps in Puppet DSL?
I'm using puppet to manage a windows server, where I have a self-written piece of software, registered as a service.
I want to write a module which installs it and ensures that always the current version is installed.
What I have are a few resources chained together to uninstall and reinstall the software:
- stop service
- call uninstall script to deregister service
- delete files
- download new files
- unzip them
- make some configurations
- call script to register service
- ensure the service is started and has the current version
Since the last one is an "ensure", I suspect it only does something if the state of the system is not as desired. The previous steps are "required" sequentially, so I want them only to be executed when the last steps ensure fails.
The implementation is not yet finished, but I suspect puppet doesn't work like this. For example, in step six I generate a configuration file as a file ressource which also has an ensure. Also, the very first step has an ensure to stop the service.
How to model a sequence of steps in Puppet DSL? Follow up question: If puppet dsl is not the place to do this, how to do this? Mind I am managing windows here, I don't want to use a 3rd party package provider. I also don't want to repackage my software to msi.