All Projects → robertdebock → ansible-role-tomcat

robertdebock / ansible-role-tomcat

Licence: Apache-2.0 License
Install and configure tomcat on your system.

Programming Languages

Jinja
831 projects

Projects that are alternatives of or similar to ansible-role-tomcat

ansible-role-logrotate
Install and configure logrotate on your system.
Stars: ✭ 13 (-61.76%)
Mutual labels:  playbook, molecule, tox
ansible-role-rsyslog
Install and configure rsyslog on your system.
Stars: ✭ 14 (-58.82%)
Mutual labels:  playbook, molecule, tox
ansible-role-dns
Install and configure dns on your system.
Stars: ✭ 39 (+14.71%)
Mutual labels:  playbook, molecule, tox
ansible-role-fail2ban
Install and configure fail2ban on your system.
Stars: ✭ 42 (+23.53%)
Mutual labels:  playbook, molecule, tox
ansible-role-dsvpn
Install and configure dsvpn on your system.
Stars: ✭ 18 (-47.06%)
Mutual labels:  playbook, molecule, tox
Ansible Role Bootstrap
Prepare your system to be managed by Ansible.
Stars: ✭ 106 (+211.76%)
Mutual labels:  playbook, molecule, tox
Ansible Grafana
Platform for analytics and monitoring
Stars: ✭ 340 (+900%)
Mutual labels:  molecule, tox
Ansible Prometheus
Deploy Prometheus monitoring system
Stars: ✭ 758 (+2129.41%)
Mutual labels:  molecule, tox
Ansible Alertmanager
Deploy Prometheus Alertmanager service
Stars: ✭ 93 (+173.53%)
Mutual labels:  molecule, tox
ansible-snmp-exporter
Provision SNMP metrics exporter for prometheus monitoring
Stars: ✭ 18 (-47.06%)
Mutual labels:  molecule, tox
ansible-war-deploy
A playbook to deploy a WAR on Tomcat & restart it.
Stars: ✭ 20 (-41.18%)
Mutual labels:  playbook, tomcat
ansible-blackbox-exporter
Blackbox prober exporter
Stars: ✭ 60 (+76.47%)
Mutual labels:  molecule, tox
Ansible Node Exporter
Provision basic metrics exporter for prometheus monitoring tool
Stars: ✭ 263 (+673.53%)
Mutual labels:  molecule, tox
ansible-coredns
Ansible provisioning of CoreDNS
Stars: ✭ 25 (-26.47%)
Mutual labels:  molecule, tox
ansible-haproxy
Ansible HAproxy role for Unified OpenStack Installer and others.
Stars: ✭ 35 (+2.94%)
Mutual labels:  playbook, molecule
ansible-fluentd
Provision fluentd log collector
Stars: ✭ 20 (-41.18%)
Mutual labels:  molecule, tox
ansible-ossec-server
Installing and maintaining the ossec-server for RedHat/Debian/Ubuntu.
Stars: ✭ 29 (-14.71%)
Mutual labels:  molecule
blase
Python module for drawing and rendering ASE (Atomic Simulation Environment) atoms and molecules objects using blender.
Stars: ✭ 12 (-64.71%)
Mutual labels:  molecule
chemiscope
An interactive structure/property explorer for materials and molecules
Stars: ✭ 41 (+20.59%)
Mutual labels:  molecule
zimbra
Ansible role to install and configure Zimbra Collaboration Open Source Edition
Stars: ✭ 33 (-2.94%)
Mutual labels:  playbook

tomcat

Install and configure tomcat on your system.

GitHub GitLab Quality Downloads Version
github gitlab quality downloads Version

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
- name: converge
  hosts: all
  become: yes
  gather_facts: yes

  vars:
    # tomcat_address: "127.0.0.1"
    tomcat_instances:
      - name: "tomcat"
      # - name: "tomcat-version-7"
      #   version: 7
      #   shutdown_port: 8007
      #   non_ssl_connector_port: 8082
      #   ssl_connector_port: 8445
      #   ajp_port: 8011
      # - name: "tomcat-version-8"
      #   version: 8
      #   shutdown_port: 8008
      #   non_ssl_connector_port: 8083
      #   ssl_connector_port: 8446
      #   ajp_port: 8012
      # - name: "tomcat-version-9"
      #   version: 9
      #   shutdown_port: 8019
      #   non_ssl_connector_port: 8084
      #   ssl_connector_port: 8447
      #   ajp_port: 8013
      # - name: "tomcat-specific"
      #   user: "specificuser"
      #   group: "specificgroup"
      #   shutdown_port: 8020
      #   shutdown_pass: shutme
      #   non_ssl_connector_port: 8085
      #   ssl_connector_port: 8448
      #   ajp_port: 8014
      #   xms: 256M
      #   xmx: 512M
      # - name: "tomcat-with-wars"
      #   shutdown_port: 8021
      #   non_ssl_connector_port: 8086
      #   ssl_connector_port: 8449
      #   ajp_port: 8015
      #   wars:
      #     - url: https://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war
      #     - url: "https://github.com/aeimer/java-example-helloworld-war/raw/master/dist/helloworld.war"
      # - name: "tomcat-java_opts"
      #   shutdown_port: 8022
      #   non_ssl_connector_port: 8087
      #   ssl_connector_port: 8449
      #   ajp_port: 8016
      #   java_opts:
      #     - name: UMASK
      #       value: "0007"
      # - name: "tomcat-with_lib"
      #   shutdown_port: 8023
      #   non_ssl_connector_port: 8088
      #   ssl_connector_port: 8450
      #   ajp_port: 8017
      #   libs:
      #     - url: "https://search.maven.org/remotecontent?filepath=io/prometheus/simpleclient/0.6.0/simpleclient-0.6.0.jar"
      # - name: "tomcat-access-logs"
      #   shutdown_port: 8024
      #   non_ssl_connector_port: 8089
      #   ssl_connector_port: 8451
      #   ajp_port: 8018
      #   access_log_enabled: yes
      #   access_log_directory: "my-logs"
      #   access_log_prefix: my-access-logs
      #   access_log_suffix: ".log"
      #   access_log_pattern: "%h %l %u %t "%r" %s %b"
      # - name: "tomcat-config-files"
      #   shutdown_port: 8025
      #   non_ssl_connector_port: 8090
      #   ssl_connector_port: 8452
      #   ajp_port: 8019
      #   ajp_secret: "SoMe-SeCrEt"
      #   config_files:
      #     - src: "{{ role_path }}/files/dummy.properties"
      #       dest: "./"
      #       mode: "0644"

  roles:
    - role: robertdebock.tomcat

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.core_dependencies
    - role: robertdebock.java

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# defaults file for tomcat

# Some "sane" defaults.
tomcat_name: tomcat
tomcat_directory: /opt
tomcat_version: 8
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: yes
tomcat_ajp_port: 8009
tomcat_ajp_secret: "SoMe-SeCrEt"
tomcat_jre_home: /usr
tomcat_service_state: started
tomcat_service_enabled: yes
# You can bind Tomcat to a specified address globally using this variable, or
# in the `tomcat_instances`. The `tomcat_instances.address` is more specific
# so it takes priority over `tomcat_address`.
tomcat_address: "0.0.0.0"

# Configure tomcat access logs
tomcat_access_log_enabled: yes
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"

# This role allows multiple installations of Apache Tomcat, each in their own
# location, potentially of different version.
# This is done by defining a "tomcat_instances" where "name:" is a unique
# identifier of an instance.
# The default tomcat_instances is one instance using the defaults described
# in defaults/main.yml.
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 }}"
    ajp_secret: "{{ tomcat_ajp_secret }}"
    # You can pick an address per instance:
    # address: "127.0.0.1"
    packet_size: 8192
    java_opts:
      - name: JRE_HOME
        value: "{{ tomcat_jre_home }}"
    access_log_enabled: "{{ tomcat_access_log_enabled }}"
    access_log_directory: "{{ tomcat_access_log_directory }}"
    access_log_prefix: "{{ tomcat_access_log_prefix }}"
    access_log_suffix: "{{ tomcat_access_log_suffix }}"
    access_log_pattern: "{{ tomcat_access_log_pattern }}"
    service_state: "{{ tomcat_service_state }}"
    service_enabled: "{{ tomcat_service_enabled }}"

# The explicit version to use when referring to the short name.
tomcat_version7: "7.0.109"
tomcat_version8: "8.5.73"
tomcat_version9: "9.0.55"

# The location where to download Apache Tomcat from.
tomcat_mirror: "https://archive.apache.org"

# If you want to download Tomcat from another location, adjust these parameters
# to your liking. For "normal" use, this does not require modification.
_tomcat_unarchive_urls:
  7:
    url: "{{ tomcat_mirror }}/dist/tomcat/tomcat-7/v{{ tomcat_version7 }}/bin/apache-tomcat-{{ tomcat_version7 }}.tar.gz"
  8:
    url: "{{ tomcat_mirror }}/dist/tomcat/tomcat-8/v{{ tomcat_version8 }}/bin/apache-tomcat-{{ tomcat_version8 }}.tar.gz"
  9:
    url: "{{ tomcat_mirror }}/dist/tomcat/tomcat-9/v{{ tomcat_version9 }}/bin/apache-tomcat-{{ tomcat_version9 }}.tar.gz"

tomcat_unarchive_url: "{{ _tomcat_unarchive_urls[tomcat_version].url }}"

Requirements

Status of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.core_dependencies Build Status GitHub Build Status GitLab
robertdebock.java Build Status GitHub Build Status GitLab
robertdebock.service Build Status GitHub Build Status GitLab

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles: dependencies

Compatibility

This role has been tested on these container images:

container tags
el 8
debian all
fedora all
opensuse all
ubuntu all

The minimum version of Ansible required is 2.10, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

Exceptions

Some roles can't run on a specific distribution or version. Here are some exceptions.

variation reason
amazonlinux:1 Not idempotent.
alpine Restart fails.

Included version(s)

This role refers to a version released by Apache Tomcat. Check the released version(s) here:

This version reference means a role may get outdated. Monthly tests occur to see if bit-rot occured. If you however find a problem, please create an issue, I'll get on it as soon as possible.

If you find issues, please register them in GitHub

License

Apache-2.0

Author Information

Robert de Bock

Please consider sponsoring me.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].