ansible-roles/newrelic/tasks/php.yml

44 lines
1.2 KiB
YAML

---
- name: Pre-seed package configuration with app name
ansible.builtin.debconf:
name: newrelic-php5
question: "newrelic-php5/application-name"
value: "{{ newrelic_appname }}"
vtype: string
when: newrelic_appname | length > 0
- name: Pre-seed package configuration with license
ansible.builtin.debconf:
name: newrelic-php5
question: "newrelic-php5/license-key"
value: "{{ newrelic_license }}"
vtype: "string"
when: newrelic_license | length > 0
- name: list newrelic config files
ansible.builtin.shell:
cmd: "find /etc/php* -type f -name newrelic.ini"
changed_when: False
check_mode: no
register: find_newrelic_ini
- name: Disable AWS detection
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: '^;?newrelic.daemon.utilization.detect_aws'
line: 'newrelic.daemon.utilization.detect_aws = false'
loop: "{{ find_newrelic_ini.stdout_lines }}"
- name: Disable Docker detection
ansible.builtin.lineinfile:
dest: "{{ item }}"
regexp: '^;?newrelic.daemon.utilization.detect_docker'
line: 'newrelic.daemon.utilization.detect_docker = false'
loop: "{{ find_newrelic_ini.stdout_lines }}"
- name: Install package for PHP
ansible.builtin.apt:
name: newrelic-php5
state: present