I have coded two different modules for Puppet one which ensures Tomcat7 is installed and running and another one which deploys a web application into Tomcat webapps folder.
However, if I run puppet as a daemon with these two modules, the application is deployed every time pupped sync with puppetmaster, so I guess I should do the following:
- Add tomcat module to the list of manifests to be execute by such node. In this way I will be sure that Tomcat is up and running every 30 minutes.
And then:
A. Invoke a no-daemonize one-time task on puppet agent through the command below using tags to specify I want to run only the deploy application module.
puppet agent --server MYSERVER --no-daemonize --onetime --tags deploy_app
B. Modify my deploy application module somehow, maybe specifying the version of the application in the artifact , to deploy automatically from puppetmaster instead of calling puppet agent.
What is the right approach? What are companies usually doing to run this kind of tasks with Puppet?
I guess that if you deploy from puppetmaster it is difficult to know when was exactly deployed your application, so you are losing control in the deployment process, what I guess is not good.