robertdebock.tomcat
Ansible Role for Tomcat
This role installs and sets up Tomcat on your system.
| GitHub | GitLab | Downloads | Version |
|---|---|---|---|
Example Playbook
Here is an example playbook from molecule/default/converge.yml that is tested for every update or request.
---
- name: Setup Tomcat
hosts: all
become: true
gather_facts: true
vars:
tomcat_instances:
- name: "tomcat"
roles:
- role: robertdebock.tomcat
Before this, prepare your machine. In CI, this is done using molecule/default/prepare.yml:
---
- name: Prepare System
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
- role: robertdebock.core_dependencies
- role: robertdebock.java
For more details, see the full explanation and example.
Role Variables
The default variable values are defined in defaults/main.yml:
---
# Defaults for Tomcat
tomcat_name: tomcat
tomcat_directory: /opt
tomcat_version: 9
tomcat_user: tomcat
tomcat_group: tomcat
tomcat_xms: 512M
tomcat_xmx: 1024M
tomcat_non_ssl_connector_port: 8080
tomcat_ssl_connector_port: 8443
tomcat_shutdown_port: 8005
tomcat_shutdown_pass: SHUTDOWN
tomcat_ajp_enabled: true
tomcat_ajp_port: 8009
tomcat_jre_home: /usr
tomcat_service_state: started
tomcat_service_enabled: true
tomcat_address: "0.0.0.0"
# Access logs configuration
tomcat_access_log_enabled: true
tomcat_access_log_directory: logs
tomcat_access_log_prefix: localhost_access_log
tomcat_access_log_suffix: ".txt"
tomcat_access_log_pattern: "%h %l %u %t "%r" %s %b"
# Instances of Tomcat can be defined
tomcat_instances:
- name: "{{ tomcat_name }}"
version: "{{ tomcat_version }}"
user: "{{ tomcat_user }}"
group: "{{ tomcat_group }}"
xms: "{{ tomcat_xms }}"
xmx: "{{ tomcat_xmx }}"
non_ssl_connector_port: "{{ tomcat_non_ssl_connector_port }}"
ssl_connector_port: "{{ tomcat_ssl_connector_port }}"
shutdown_port: "{{ tomcat_shutdown_port }}"
ajp_enabled: "{{ tomcat_ajp_enabled }}"
ajp_port: "{{ tomcat_ajp_port }}"
java_opts:
- name: JRE_HOME
value: "{{ tomcat_jre_home }}"
service_state: "{{ tomcat_service_state }}"
service_enabled: "{{ tomcat_service_enabled }}"
# Versions of Tomcat
tomcat_version7: "7.0.109"
tomcat_version8: "8.5.73"
tomcat_version9: "9.0.55"
tomcat_version10: "10.1.12"
# Location to download Tomcat
tomcat_mirror: "https://archive.apache.org"
Requirements
- Python packages listed in requirements.txt.
Required Roles
These roles set up your system:
| Requirement | GitHub | GitLab |
|---|---|---|
| robertdebock.bootstrap | ||
| robertdebock.core_dependencies | ||
| robertdebock.java |
Context
This role works with other compatible roles. For more details, check the documentation of these roles.
Compatibility
This role has been tested on the following container images:
| Container | Tags |
|---|---|
| EL | 9 |
| Debian | all |
| Fedora | all |
| Ubuntu | all |
The minimum required version of Ansible is 2.12. Tests have been conducted on:
- Previous versions.
- Current version.
- Development version.
If you encounter problems, please report them on GitHub.
License
This project is licensed under Apache-2.0.
Author Information
Please consider supporting me.
ansible-galaxy install robertdebock.tomcat