This Ansible role installs and configures the Dynatrace AppMon Agent of the Dynatrace AppMon solution for the Apache Tomcat application server.
Note: this role makes the Dynatrace AppMon Agent available to Apache Tomcat by injecting an appropriate -agentpath option into an environment variable, e.g. CATALINA_OPTS
, inside a file (typically an executable script). It is assumed that this script either executes Apache Tomcat directly or is sourced by another script before Apache Tomcat gets executed. You will have to restart your application after placing the agent.
The role is available via:
This roles depends on the following roles:
As defined in defaults/main.yml
:
Name | Default | Description |
---|---|---|
dynatrace_tomcat_agent_env_var_name | CATALINA_OPTS | The name of the environment variable to be used for Agent injection. |
dynatrace_tomcat_agent_env_var_file_name | required | The name of the file to be modified. |
dynatrace_tomcat_agent_env_var_file_insert_after | BOF | A regex, BOF or EOF for begin-of-file and end-of-file, respectively. If a given regex is not matched, the -agentpath option will be appended to the file. |
dynatrace_tomcat_agent_name | apache-tomcat-agent | The name of the Java Agent as it appears in Dynatrace AppMon. |
dynatrace_tomcat_agent_collector_hostname | localhost | The location of the collector the Agent shall connect to. |
dynatrace_tomcat_agent_collector_port | 9998 | The port on the collector the Agent shall connect to. |
dynatrace_tomcat_agent_linux_agent_path | /opt/dynatrace/agent/lib64/libdtagent.so | The path to the Agent libary. |
dynatrace_tomcat_agent_state | present | Whether the Agent shall be present or absent . |
- hosts: all
roles:
- role: Dynatrace.Dynatrace-Tomcat-Agent
dynatrace_tomcat_agent_env_var_file_name: /opt/tomcat/bin/catalina.sh
dynatrace_tomcat_agent_env_var_file_insert_after: '#!/bin/sh'
We use Test Kitchen to automatically test our automated deployments with Serverspec and RSpec:
- Install Test Kitchen and its dependencies from within the project's directory:
gem install bundler
bundle install
- Run all tests
kitchen test
By default, we run our tests inside Docker containers as this considerably speeds up testing time (see .kitchen.yml
).
- How to Automate Enterprise Application Monitoring with Ansible
- How to Automate Enterprise Application Monitoring with Ansible - Part II
- Automated Deployments (of Dynatrace AppMon) with Ansible
- Test-Driven Infrastructure with Ansible, Test Kitchen, Serverspec and RSpec
This offering is Dynatrace Community Supported. Feel free to share any problems, questions and suggestions with your peers on the Dynatrace Community's Application Monitoring & UEM Forum.
Licensed under the MIT License. See the LICENSE file for details.