dynatraceoneagent
Version information
This version is compatible with:
- Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 7.0.0
- , , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'dynatrace-dynatraceoneagent', '1.9.0'
Learn more about managing modules with a PuppetfileDocumentation
Dynatrace OneAgent module for puppet
Table of Contents
- Module Description - What is the Dynatrace OneAgent module and what does it do?
- Setup - The basics of getting started with the Dynatrace OneAgent
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Module description
This module deploys the Dynatrace OneAgent on Linux, Windows and AIX Operating Systems with different available configurations and ensures the OneAgent service maintains a running state. It provides the resource types to interact with the various OneAgent configuration files and the oneagentctl
Setup
What the Dynatrace OneAgent affects
- Installs the Dynatrace OneAgent package with the selected parameters and manages its config files.
- By default, enables the Dynatrace OneAgent boot-start, and uses the generated service file as part of the installer to manage the Dynatrace OneAgent service.
- Any running processes prior to installing the OneAgent package will need to be restarted for full instrumentation, a server reboot is another alternative.
Setup requirements
This module requires puppet/archive as well as puppet-labs/reboot for server restarts.
For uninstalling the OneAgent on Windows, the puppetlabs-powershell module is required.
To begin using this module, use the Puppet Module Tool (PMT) from the command line to install this module:
puppet module install dynatrace-dynatraceoneagent
You will then need to supply the dynatraceoneagent class with two critical pieces of information.
- The tenant URL: Managed
https://{your-domain}/e/{your-environment-id}
| SaaShttps://{your-environment-id}.live.dynatrace.com
- The PaaS token of your environment for downloading the OneAgent installer
Refer to the customize OneAgent installation documentation on Dynatrace Supported Operating Systems This module uses the Dynatrace deployment API for downloading the installer for each supported OS. See Deployment API
Beginning with the Dynatrace OneAgent
To have Puppet install the OneAgent, declare the `dynatraceoneagent' class:
class { 'dynatraceoneagent':
tenant_url => 'https://{your-environment-id}.live.dynatrace.com',
paas_token => '{your-paas-token}',
}
When you declare this class with the mandatory options, the module:
- downloads the required binaries needed to install the OneAgent on the target host
- Installs the OneAgent with the default installation parameters: --set-infra-only=false, --set-app-log-content-access=true
- Applies any specified configuration via the oneagentctl
- Ensures the Dynatrace OneAgent service is running and enabled.
Usage
Default OneAgent install parameters defined in params.pp as a hash map: --set-infra-only=false, --set-app-log-content-access=true
Most basic OneAgent installation using a SAAS tenant
class { 'dynatraceoneagent':
tenant_url => 'https://{your-environment-id}.live.dynatrace.com',
paas_token => '{your-paas-token}',
}
OneAgent installation using a managed tenant with a specific version
The required version of the OneAgent must be in 1.155.275.20181112-084458 format. See Deployment API - GET available versions of OneAgent
class { 'dynatraceoneagent':
tenant_url => 'https://{your-domain}/e/{your-environment-id}',
paas_token => '{your-paas-token}',
version => '1.181.63.20191105-161318',
}
Verify Installer Signature (Linux/AIX Only)
Set the verify_signature
parameter to true
if the module should verify the signature of the OneAgent Linux/AIX installer prior to installation. If set to true
the module will download the dynatrace root cert file to download_dir
default value from the URL default value set for download_cert_link
and use it for verification. If the verification fails, Puppet will attempt to delete the installer file downloaded by the puppet/archive module causing a failure on the remaining tasks.
class { 'dynatraceoneagent':
tenant_url => 'https://{your-environment-id}.live.dynatrace.com',
paas_token => '{your-paas-token}',
verify_signature => true,
}
Advanced configuration
Download OneAgent installer to a custom directory with additional OneAgent install parameters and reboot server after install should be defined as follows (will override default install params):
class { 'dynatraceoneagent':
tenant_url => 'https://{your-environment-id}.live.dynatrace.com',
paas_token => '{your-paas-token}',
version => '1.181.63.20191105-161318',
download_dir => 'C:\\Download Dir',
reboot_system => true,
oneagent_params_hash => {
'--set-infra-only' => 'false',
'--set-app-log-content-access' => 'true',
'--set-host-group' => 'PUPPET_WINDOWS',
'INSTALL_PATH' => 'C:\\Test Directory',
}
}
For further information on how to handle file paths on Windows, visit Files and paths on Windows
Set or update OneAgent configuration and host metadata
This module supports the oneagentctl which can be used to apply configurations as well as add/change metadata during or after the installation of the OneAgent.
class { 'dynatraceoneagent':
tenant_url => 'https://{your-domain}/e/{your-environment-id}',
paas_token => '{your-paas-token}',
host_group => 'APACHE_LINUX',
host_metadata => ['Environment=Dev', 'Organization=D2P', 'Owner=joe.doe@dynatrace.com', 'Support=https://www.dynatrace.com/support/windows'],
host_tags => ['ApacheHost', 'Gdansk', 'role=fallback', 'app=easyTravel'],
hostname => 'apache.puppet.vm',
log_monitoring => false,
log_access => false,
infra_only => true,
}
Update OneAgent communication
Use the oneagent_communication_hash
parameter to change OneAgent communication settings during/after installation:
class { 'dynatraceoneagent':
tenant_url => 'https://{your-domain}/e/{your-environment-id}',
paas_token => '{your-paas-token}',
oneagent_communication_hash => {
'--set-server' => 'https://my-server.com:443',
'--set-tenant' => 'abc654321',
'--set-tenant-token' => 'abcdefg123456790',
'--set-proxy' => 'my-proxy.com',
},
}
It is recommended that any settings that can be configured via the installation parameters are used before resorting to the oneagentctl, see REFERENCE.md for supported parameters.
Reference
Seen in file REFERENCE.md
Limitations
For an extensive list of supported operating systems, see metadata.json
Visit Technology Support for details on supported Operating Systems and limitations.
Visit oneagentctl for details on limitations around the OneAgent command line interface.
Development
Testing
Acceptance tests for this module leverage puppet_litmus. To run the acceptance tests follow the instructions here. You can also find a tutorial and walkthrough of using Litmus and the PDK on YouTube.
An example script for running acceptance tests can be found on the run_acc_tests.sh file.
Reference
Table of Contents
Classes
dynatraceoneagent
: This module deploys the OneAgent on Linux, Windows and AIX Operating Systems with different available configurations and ensures the OneAgent service maintains a running state. It provides types/providers to interact with the various OneAgent configuration points.dynatraceoneagent::config
: This class manages the configuration of the OneAgentdynatraceoneagent::download
: This class downloads the OneAgent installer binarydynatraceoneagent::install
: This class manages the installation of the OneAgent on the hostdynatraceoneagent::params
: This class manages the OneAgent parametersdynatraceoneagent::service
: Manages the OneAgent servicedynatraceoneagent::uninstall
: Uninstalls the Dynatrace OneAgent
Classes
dynatraceoneagent
This module deploys the OneAgent on Linux, Windows and AIX Operating Systems with different available configurations and ensures the OneAgent service maintains a running state. It provides types/providers to interact with the various OneAgent configuration points.
Examples
class { 'dynatraceoneagent':
tenant_url => 'https://{your-environment-id}.live.dynatrace.com',
paas_token => '{your-paas-token}',
}
Parameters
The following parameters are available in the dynatraceoneagent
class:
global_mode
tenant_url
paas_token
api_path
version
arch
installer_type
verify_signature
proxy_server
download_cert_link
cert_file_name
ca_cert_src_path
allow_insecure
download_options
download_dir
default_install_dir
oneagent_params_hash
reboot_system
service_state
manage_service
service_name
package_state
host_tags
host_metadata
hostname
oneagent_communication_hash
log_monitoring
log_access
host_group
infra_only
network_zone
oneagent_puppet_conf_dir
oneagent_ctl
provider
oneagent_comms_config_file
oneagent_logmonitoring_config_file
oneagent_logaccess_config_file
hostgroup_config_file
hostmetadata_config_file
hostautotag_config_file
hostname_config_file
oneagent_infraonly_config_file
oneagent_networkzone_config_file
global_mode
Data type: String
Sets the permissions for any files that don't have this assignment either set manually or by the OneAgent installer
Default value: $dynatraceoneagent::params::global_mode
tenant_url
Data type: String
URL of your dynatrace Tenant
Managed https://{your-domain}/e/{your-environment-id}
- SaaS https://{your-environment-id}.live.dynatrace.com
Default value: $dynatraceoneagent::params::tenant_url
paas_token
Data type: String
Paas token for downloading the OneAgent installer
Default value: $dynatraceoneagent::params::paas_token
api_path
Data type: String
Path of the Dynatrace OneAgent deployment API
Default value: $dynatraceoneagent::params::api_path
version
Data type: String
The required version of the OneAgent in 1.155.275.20181112-084458 format
Default value: $dynatraceoneagent::params::version
arch
Data type: String
The architecture of your OS - default is all
Default value: $dynatraceoneagent::params::arch
installer_type
Data type: String
The type of the installer - default is default
Default value: $dynatraceoneagent::params::installer_type
verify_signature
Data type: Optional[Boolean]
Verify OneAgent installer signature (Linux only).
Default value: $dynatraceoneagent::params::verify_signature
proxy_server
Data type: Optional[String]
Proxy server to be used by the archive module for downloading the OneAgent installer if needed
Default value: $dynatraceoneagent::params::proxy_server
download_cert_link
Data type: Optional[String]
Link for downloading dynatrace root cert pem file
Default value: $dynatraceoneagent::params::download_cert_link
cert_file_name
Data type: Optional[String]
Name of the downloaded cert file
Default value: $dynatraceoneagent::params::cert_file_name
ca_cert_src_path
Data type: Optional[String]
Location of dynatrace root cert file in module
Default value: $dynatraceoneagent::params::ca_cert_src_path
allow_insecure
Data type: Optional[Boolean]
Ignore HTTPS certificate errors when using the archive module.
Default value: $dynatraceoneagent::params::allow_insecure
download_options
Data type: Optional
In some cases you may need custom flags for curl/wget/s3 which can be supplied via download_options. Refer to Download Customizations
Default value: $dynatraceoneagent::params::download_options
download_dir
Data type: String
OneAgent installer file download directory.
Default value: $dynatraceoneagent::params::download_dir
default_install_dir
Data type: String
OneAgent default install directory
Default value: $dynatraceoneagent::params::default_install_dir
oneagent_params_hash
Data type: Hash
Hash map of additional parameters to pass to the installer Refer to the Customize OneAgent installation documentation on Technology Support
Default value: $dynatraceoneagent::params::oneagent_params_hash
reboot_system
Data type: Boolean
If set to true, puppet will reboot the server after installing the OneAgent - default is false
Default value: $dynatraceoneagent::params::reboot_system
service_state
Data type: String
What state the dynatrace oneagent service should be in - default is running Allowed values: running, stopped
Default value: $dynatraceoneagent::params::service_state
manage_service
Data type: Boolean
Whether puppet should manage the state of the OneAgent service - default is true
Default value: $dynatraceoneagent::params::manage_service
service_name
Data type: String
The name of the dynatrace OneAgent based on the OS
Default value: $dynatraceoneagent::params::service_name
package_state
Data type: String
What state the dynatrace oneagent package should be in - default is present Allowed values: present, absent
Default value: $dynatraceoneagent::params::package_state
host_tags
Data type: Optional[Array]
Values to automatically add tags to a host, should contain an array of strings or key/value pairs. For example: ['Environment=Prod', 'Organization=D1P', 'Owner=john.doe@dynatrace.com', 'Support=https://www.dynatrace.com/support/linux']
Default value: $dynatraceoneagent::params::host_tags
host_metadata
Data type: Optional[Array]
Values to automatically add metadata to a host, Should contain an array of strings or key/value pairs. For example: ['LinuxHost', 'Gdansk', 'role=fallback', 'app=easyTravel']
Default value: $dynatraceoneagent::params::host_metadata
hostname
Data type: Optional[String]
Overrides an automatically detected host name. Example: My App Server
Default value: $dynatraceoneagent::params::hostname
oneagent_communication_hash
Data type: Optional[Hash]
Hash map of parameters used to change OneAgent communication settings Refer to Change OneAgent communication settings on Communication Settings
Default value: $dynatraceoneagent::params::oneagent_communication_hash
log_monitoring
Data type: Optional[Boolean]
Enable or disable Log Monitoring
Default value: $dynatraceoneagent::params::log_monitoring
log_access
Data type: Optional[Boolean]
Enable or disable access to system logs
Default value: $dynatraceoneagent::params::log_access
host_group
Data type: Optional[String]
Change host group assignment
Default value: $dynatraceoneagent::params::host_group
infra_only
Data type: Optional[Boolean]
Enable or disable Infrastructure Monitoring mode
Default value: $dynatraceoneagent::params::infra_only
network_zone
Data type: Optional[String]
Set the network zone for the host
Default value: $dynatraceoneagent::params::network_zone
oneagent_puppet_conf_dir
Data type: String
Directory puppet will use to store oneagent configurations
Default value: $dynatraceoneagent::params::oneagent_puppet_conf_dir
oneagent_ctl
Data type: String
Name of oneagentctl executable file
Default value: $dynatraceoneagent::params::oneagent_ctl
provider
Data type: String
The specific backend to use for this exec resource.
Default value: $dynatraceoneagent::params::provider
oneagent_comms_config_file
Data type: String
Configuration file location for OneAgent communication
Default value: $dynatraceoneagent::params::oneagent_comms_config_file
oneagent_logmonitoring_config_file
Data type: String
Configuration file location for OneAgent log monitoring
Default value: $dynatraceoneagent::params::oneagent_logmonitoring_config_file
oneagent_logaccess_config_file
Data type: String
Configuration file location for OneAgent log access
Default value: $dynatraceoneagent::params::oneagent_logaccess_config_file
hostgroup_config_file
Data type: String
Configuration file location for OneAgent host group value
Default value: $dynatraceoneagent::params::hostgroup_config_file
hostmetadata_config_file
Data type: String
Configuration file location for OneAgent host metadata value(s)
Default value: $dynatraceoneagent::params::hostmetadata_config_file
hostautotag_config_file
Data type: String
Configuration file location for OneAgent host tag value(s)
Default value: $dynatraceoneagent::params::hostautotag_config_file
hostname_config_file
Data type: String
Configuration file location for OneAgent host name value
Default value: $dynatraceoneagent::params::hostname_config_file
oneagent_infraonly_config_file
Data type: String
Configuration file location for OneAgent infra only mode
Default value: $dynatraceoneagent::params::oneagent_infraonly_config_file
oneagent_networkzone_config_file
Data type: String
Configuration file location for OneAgent network zone value
Default value: $dynatraceoneagent::params::oneagent_networkzone_config_file
dynatraceoneagent::config
This class manages the configuration of the OneAgent
dynatraceoneagent::download
This class downloads the OneAgent installer binary
dynatraceoneagent::install
This class manages the installation of the OneAgent on the host
dynatraceoneagent::params
This class manages the OneAgent parameters
dynatraceoneagent::service
Manages the OneAgent service
dynatraceoneagent::uninstall
Uninstalls the Dynatrace OneAgent
Changelog
All notable changes to this project will be documented in this file.
Release 1.9.0
Features
- Provide option to disable puppet from managing the OneAgent service using the
manage_service
parameter - Dynatrace root cert file is now directly passed with module instead of requiring archive for download
Bugfixes
TBD
Known Issues
TBD
Release 1.8.0
Features
- Simplified conditions by setting conditions on class containment on init.pp
- Move uninstall tasks to new
dynatraceoneagent::uninstall
class.
Bugfixes
- Dynatrace OneAgent Windows uninstalls now executed via PowerShell
Known Issues
TBD
Release 1.7.0
Features
- Add download_options parameter on Archive resource in case custom flags are needed for curl/wget/s3 when downloading the OneAgent installer
Bugfixes
- Added
--restart-service
parameter tooneagentctl --set-network-zone
command
Known Issues
TBD
Release 1.6.0
Features
- Use shell (
/bin/sh
) to run OneAgent install script on Linux and AIX systems - Remove resource
file{ $download_path:}
as it is not needed anymore with the addition of shell to the install OneAgent command
Bugfixes
- Fixed if statements with missing or with wrong conditions that checked for the AIX/Linux Operating System from the host facts.
Known Issues
TBD
Release 1.5.0
Features
- Add oneagentctl support
- Add option to verify OneAgent Linux/AIX installer file signature
- OneAgent service state can now be set using the
service_state
parameter - OneAgent package state can now be set using the
package_state
parameter - Use
reboot
module for both linux and windows reboots - Convert
host_metadata
string parameter to array - Convert
host_tags
string parameter to array - Following best practice, OneAgent metadata including host tags, host metadata and hostname is now set via
oneagentclt
instead of configuration files. - Add
download
class to separately handle OneAgent binary download - Add windows fact
dynatrace_oneagent_appdata
- Add windows fact
dynatrace_oneagent_programfiles
- Add acceptance tests using the Litmus test framework
Bugfixes
- Remove
ensure => present
fromfile{ $download_path:}
resource to ensure no file is present if OneAgent installer download fails. - data/common.yaml file now has valid yaml
Known Issues
TBD
Release 1.4.0
Features
TBD
Bugfixes
- Make proxy_server param optional
Known Issues
TBD
Release 1.3.0
Features
TBD
Bugfixes
- Add proxy_server var to init.pp
Known Issues
TBD
Release 1.2.0
Features
- Add proxy server resource for archive module
Bugfixes
TBD
Known Issues
TBD
Release 1.1.0
Features
TBD
Bugfixes
- Fix config directory dependency issue by installing OneAgent package in install.pp
Known Issues
TBD
Release 1.0.0
Features
- Ability to set string values to the hostcustomproperties.conf and hostautotag.conf of the OneAgent config to add tags and metadata to a host entity.
- Ability to override the automatically detected hostname by setting the values of the hostname.conf file and restarting the Dynatrace OneAgent service.
Bugfixes
- Remove debug message for whenever reboot parameter was set to false
Known Issues
TBD
Release 0.5.0
Features
- Ability to download specific version
- Module will automatically detect OS and download required installer
- Module will automatically detect OS and will run the installer package required
- Add AIX support
- Add support for OneAgent Install Params
- Implement Archive module for OneAgent installer downloads
- Reboot functionality included
- Module built and validated with PDK
Bugfixes
- Fix OneAgent download issue
- Fix module directory issue
Known Issues
TBD
MIT License Copyright (c) 2008-2021 Dynatrace LLC Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.