amtega.tomcat_application
Ansible tomcat_application Role
This is an Ansible role that helps to deploy applications on Tomcat server instances. It also sets up datasources and directories.
Role Variables
You can find a list of default variables for this role in defaults/main.yml
. The role establishes the following settings:
tomcat_application_server_instances: A list containing information about Tomcat instances. Each item includes:
name
,service
,base
,home
,user
,group
,autodeploy
, andjsvc
.tomcat_application_datasources_deployed: Datasources that have been set up for the application.
tomcat_artifacts_deployed: Artifacts related to the application that have been deployed.
Example Playbook
Here is an example of how to use the role in a playbook:
---
- hosts: all
roles:
- role: tomcat_application
tomcat_application_name: sample
tomcat_application_instances:
- tomcat@server1
- tomcat@server2
tomcat_application_artifacts:
- url: https://tomcat.apache.org/tomcat-8.0-doc/appdev/sample/sample.war
dest: webapps
timeout: 60
validate_certs: false
tomcat_application_dirs:
- "config/wanda"
- "log/wanda"
- "cert/wanda"
- "data/wanda"
- "resource/wanda"
tomcat_application_datasources:
- name: "jdbc/wandaDataSource"
auth: Container
type: acme.jdbc.pool.AcmeDataSource
factory: acme.jdbc.pool.AcmeDataSourceFactory
driverClassName: acme.jdbc.AcmeDriver
maxTotal: 100
maxIdle: 30
maxWaitMilli: 10000
url: dbc:acme:@DATABASE
user: app
password: app_password
tomcat_application_managers:
- instance: tomcat@server1
url: http://localhost:8080
user: admin
password: admin
timeout: 5
retries: 5
delay: 3
- instance: tomcat@server2
url: http://localhost:8081
user: admin
password: admin
timeout: 5
retries: 5
delay: 3
Testing
To test the role, you can use Molecule with Docker containers.
Run the following commands:
cd amtega.tomcat_application
molecule test --all
License
Copyright (C) 2022 AMTEGA - Xunta de Galicia
This role is free software. You can share or change it under the terms of:
GNU General Public License version 3, or any later version; or the European Union Public License, either Version 1.2 or any later versions approved by the European Commission.
This role is provided with the hope that it will be useful, but there is NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For more details, see the GNU General Public License or the European Union Public License.
Author Information
- Juan Antonio Valiño García.
Deploy a tomcat application and its datasources and directories
ansible-galaxy install amtega.tomcat_application