PDF
Download PDF
Download page Ansible Configuration for PHP Agent.
Ansible Configuration for PHP Agent
The following sections provide the example use cases for the PHP Agent Ansible Role:
Example 1: The following is an example of AnsibleĀ® role to install PHP Agent on Linux:
---
- hosts: all
tasks:
- include_role:
name: appdynamics.agents.php
vars:
agent_version: latest
agent_type: php
agent_action: upgrade
application_name: e-commerce
controller_account_access_key: "123key"
controller_host_name: "fieldlab.saas.appdynamics.com"
controller_account_name: "customer1"
enable_ssl: false
controller_port: 8090
tier_name: tier1
node_name: node1
log_directory: "/opt/appdynamics/php-agent/ecommerce_logs"
zts_support: false
# proxy configs
proxy_host: master.ecommerce-proxy.com
proxy_port: 8080
proxy_user: ecommerce-user
proxy_password_file: /etc/ecommerce/passwd
proxy_ctrl_dir: /ecommerce/proxy_dir/
YML
Example 2: The following is an example of Ansible role to upgrade PHP Agent on Linux where agent is already installed:
---
- hosts: all
tasks:
- include_role:
name: appdynamics.agents.php
vars:
agent_version: latest
agent_type: php
agent_action: upgrade
application_name: e-commerce
controller_account_access_key: "123key"
controller_host_name: "fieldlab.saas.appdynamics.com"
controller_account_name: "customer1"
enable_ssl: false
controller_port: 8090
tier_name: tier1
node_name: node1
log_directory: "/opt/appdynamics/php-agent/ecommerce_logs"
zts_support: false
linux_custom_agent_install_path: "/home/ubuntu/ecommerce_agent/" #this path should contain the agent files (eg: install.sh ,php etc)
custom_agent_ini_file: "/etc/php/7.4/cli/conf.d/appdynamics_agent.ini" #this file should contain your agent controller details
YML
PHP Agent Variables
Variable | Description | Possible Values | Required | Default |
---|---|---|---|---|
custom_agent_ini_file | Set the absolute path of the appdynamics_agent.ini file. | <custom path> By default, it takes the default .ini file path set in PHP settings | Yes, if linux_custom_agent_install_path is defined | None |
enable_cli | Set to true if you want to enable the CLI mode. | true or false | Optional | None |
enable_cli_long_running | Set to true to defend PHP in long-running CLI applications. See Configure the Agent for PHP CLI Applications. | true or false | Optional | false |
ignore_permissions | Set to true if you want to ignore file and directory permission issues. | true or false | Optional | None |
log_directory | Specify your logs directory. By default, logs folder is created inside agent directory. | <agent-directory>/logs | Optional | <agent-directory>/logs |
php_executable_path | Specify the path for the PHP binary. | /usr/bin/php | Optional | global php path set |
php_ini_dir | Directory for the appdynamics_agent.ini file. | /etc/php/ | Required on Ubuntu and when the default PHP CLI binary cannot be determined. | global php ini path set |
php_extension_dir | Extensions directory for the appdynamics_agent.so file. | /etc/php/extensions/ | Required on Ubuntu and when the default PHP CLI binary cannot be determined. | global php extension path set |
php_version | Version of PHP that you are instrumenting. Valid formats are version numbers to one or two decimal positions, for example, 7.4 and 7.4.29. | 7.4.29 | Required when the default PHP CLI binary cannot be determined or there is no PHP CLI binary. | global php verdsion set |
zts_support | Set to true to install PHP ZTS agent. | true or false | Optional | false |
Important
- Use the
php -i|grep appdynamics_agent.ini
command to get theappdynamics_agent.ini
path. Set thecustom_agent_ini_file
with the absolute file path if your agent in not installed in default location or if you are usinglinux_custom_agent_install_path.
- If you want to install agent in PHP version which is not set globally, you must define the following variables. These are mandatory variables for all
agent_action
:
php_executable_path
php_ini_dir
php_extension_dir
php_version
Custom Proxy Configuration Variables
Variable | Description | Possible Values | Required | Default |
---|---|---|---|---|
proxy_host | Proxy host to route data to the Controller through a proxy server. | master.ecommerce-proxy.com | Optional | None |
proxy_port | Proxy port to route data to the Controller through a proxy server. | 8090 | Optional | None |
proxy_user | Proxy user required to log in to proxy server host. | ecommere-user | Optional | None |
proxy_password_file | Proxy password file to log in to proxy server host. | /etc/ecommerce/passwd | Optional | None |
proxy_ctrl_dir | The proxy control directory. If not specified, the installer creates a temporary directory. | /ecommerce/proxy_dir/ | Optional | None |
Unable to render {include} The included page could not be found.