This state uses the manager webapp to manage Apache tomcat webapps This state requires the manager webapp to be enabled
The following grains/pillar should be set:
tomcat-manager.user: admin user name
tomcat-manager.passwd: password
and also configure a user in the conf/tomcat-users.xml file:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-script"/>
<user username="tomcat" password="tomcat" roles="manager-script"/>
</tomcat-users>
Notes:
Not supported multiple version on the same context path
More information about tomcat manager: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html
if you use only this module for deployments you've might want to strict access to the manager only from localhost for more info: http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html#Configuring_Manager_Application_Access
Tested on:
Sun Microsystems Inc.
1.6.0_43-b01
amd64
Linux
2.6.32-358.el6.x86_64
Apache Tomcat/7.0.37
The tomcat watcher function. When called it will reload the webapp in question
Wait for the tomcat manager to load
notice that if the tomcat is not running we won't wait for it start and the state will fail this state can be required in the tomcat.war_deployed state to make sure tomcat is running and that the manager is running as well and ready for deployment
Example:
tomcat-service:
service:
- running
- name: tomcat
- enable: True
wait-for-tomcatmanager:
tomcat:
- wait
- timeout: 300
- require:
- service: tomcat-service
jenkins:
tomcat:
- war_deployed
- name: /ran
- war: salt://jenkins-1.2.4.war
- require:
- tomcat: wait-for-tomcatmanager
Enforce that the WAR will be deployed and started in the context path it will make use of WAR versions
for more info: http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Naming
Example:
jenkins:
tomcat.war_deployed:
- name: /ran
- war: salt://jenkins-1.2.4.war
- require:
- service: application-service