In the puppet, you cannot announce the same service again. that you have a mistake.
With a puppet, you donβt have to worry about tomcat stop / start processes. It assumes the final status (called "idemotency"). Once you determine the relationship between packages, configuration files, and services, it will complete all the tasks for you. For example, you should understand below the processes in the puppet and the differences between -> and ~> .
Package['tomcat'] -> File['server.xml'] ~> Service['tomcat']
In your case, you make changes to the tomcat configuration file, and the puppet automatically restarts the tomcat services.
For your reference, here is a paste copy from Introduction to Puppet to explain what idempotency means:
One big difference between the puppet and most other tools is that the Puppet configurations are idempotent, meaning that they can be run safely several times. After you develop your configuration, your machines will apply the configuration often - by default, every 30 minutes - and the puppet will make any changes to the system if the state of the system does not match the configured state.
Update 2016:
Here is another official Puppet blog post on idempotency: https://puppet.com/blog/idempotence-not-just-a-big-and-scary-word
source share