pescobar.apache_tomcat
pescobar.apache_tomcat
This is an Ansible role for installing and configuring Apache Tomcat on CentOS/RHEL systems.
Requirements
Make sure to have the following:
- Supported Tomcat versions:
- 7.0
- 8.0
- 8.5
- 9.0 (9.0.1 or later)
- Operating system: CentOS/RHEL 7
- SELinux must be disabled.
Installation
To install this role, run:
$ ansible-galaxy install pescobar.apache_tomcat
Example Playbooks
Playbook to Install Java from CentOS RPMs
- hosts: servers
vars:
tomcat_users:
- username: "tomcat"
password: "t3mpp@ssw0rd"
roles: "tomcat,admin,manager,manager-gui"
- username: "exampleuser"
password: "us3rp@ssw0rd"
roles: "tomcat"
roles:
- role: pescobar.apache_tomcat
Playbook to Install Java Using External Role
- hosts: servers
vars:
tomcat_install_java: false # We install Java using role pescobar.java_openjdk
tomcat_java_home: /opt/java # Location of Java
tomcat_users:
- username: "tomcat"
password: "t3mpp@ssw0rd"
roles: "tomcat,admin,manager,manager-gui"
- username: "exampleuser"
password: "us3rp@ssw0rd"
roles: "tomcat"
roles:
- role: pescobar.java_openjdk
- role: pescobar.apache_tomcat
Key Variables
tomcat_version: Define the Tomcat version to install.
Reviewable Variables:
tomcat_install_java: Set toTrueto install OpenJDK; set it toFalseif you don’t want Java to be installed.tomcat_java_version: Default is1.8. Latest version is11.tomcat_install_path: Default installation location is/opt.- JVM Memory Management:
tomcat_jvm_memory_percentage_xms: Minimum JVM heap size as a percentage of total memory (default 15%).tomcat_jvm_memory_percentage_xmx: Maximum JVM heap size as a percentage of total memory (default 55%).
- Access Restrictions:
tomcat_allow_manager_access_only_from_localhost: Set toTruefor local access only.tomcat_allow_host_manager_access_only_from_localhost: Set toTruefor local access only.
tomcat_users: List of users to create (refer to example for format).tomcat_debug_mode: Set toTruefor remote debugging; default port istcp/8000.
File Permissions:
- For production (
tomcat_permissions_productionset toTrue), files are owned by root; otherwise, they are owned by Tomcat. - Automatic Deployment:
tomcat_webapps_auto_deploymentshould ideally be set toFalsefor security.
Tomcat Ports:
- Connector Port:
tomcat_port_connector: 8080 - Shutdown Port:
tomcat_port_shutdown: 8005 - Redirect Port:
tomcat_port_redirect: 8443 - AJP Port:
tomcat_port_ajp: 8009 - Debug Port:
tomcat_port_debug: 8000
Defaults:
tomcat_service_name: tomcattomcat_service_enabled_on_startup: True
Uninstallation
- To uninstall Tomcat, set
tomcat_statetoabsent. - Backups are created by default before uninstallation.
- To remove Java, set
tomcat_uninstall_remove_javatoTrue. - To keep the Tomcat user and group, set
tomcat_uninstall_remove_userandtomcat_uninstall_remove_grouptoFalse. - To remove everything, set
tomcat_uninstall_remove_alltoTrue.
Informazioni sul progetto
Ansible role to install and configure Apache Tomcat on CentOS/RHEL
Installa
ansible-galaxy install pescobar.apache_tomcatLicenza
gpl-2.0
Download
59.3k
Proprietario
Systems engineer. Linux/HPC/Cloud/BioInfo
