Closed 8mccm8 closed 1 year ago
Hi @8mccm8!
We configure the infrastructure agent's proxy
settings with an ansible environment variable (HTTPS_PROXY
, see it here) when executing the ansible playbook, so that users don't have to modify the /etc/newrelic-infra.yml
by themselves.
If for any reason you still want to add a proxy
config to the /etc/newrelic-infra.yml
, please take a look at these docs:
HI @amolero-nr
I set HTTPS_PROXY
and the installation was done correctly BUT the proxy
directive was not set in /etc/newrelic-infra.yml
and my agent can't send metrics to the API...
I willl check again tomorrow.
Hey @8mccm8,
In my test, after setting the HTTPS_PROXY
env var like this below in my playbook:
- name: Install New Relic
hosts: linux
roles:
- role: newrelic.newrelic_install
vars:
targets:
- infrastructure
- logs
environment:
NEW_RELIC_API_KEY: "..."
NEW_RELIC_ACCOUNT_ID: "..."
NEW_RELIC_REGION: "..."
HTTPS_PROXY: "http://MY_PROXY:PORT"
I got the config
option successfully added to my newrelic-infra.yml
as follows:
enable_process_metrics: true
status_server_enabled: true
status_server_port: 18003
license_key: < ... >
custom_attributes:
nr_deployed_by: ansible-install
proxy: http://172.31.45.182:3128 # <-- HERE
hi @amolero-nr
definitely not:
- role: roles/newrelic.newrelic-infra_new
vars:
targets:
- infrastructure
install_timeout_seconds: 1000
verbosity: debug
environment:
NEW_RELIC_API_KEY: "{{nrinfragent_env.NEW_RELIC_API_KEY }}"
NEW_RELIC_ACCOUNT_ID: "{{ nrinfragent_env.NEW_RELIC_ACCOUNT_ID }}"
http_proxy: "{{ proxy_env_redhat.http_proxy }}"
https_proxy: "{{ proxy_env_redhat.https_proxy }}"
cat /etc/newrelic-infra.yml
enable_process_metrics: true
status_server_enabled: true
status_server_port: 18003
license_key: xxxxxxxxxxxxxxxxxxxxx
custom_attributes:
nr_deployed_by: ansible-install
I must add this if I want proxy in my config:
roles:
- role: roles/newrelic.newrelic-infra_new
vars:
targets:
- infrastructure
tags:
proxy: "{{ proxy_env_redhat.https_proxy }}"
install_timeout_seconds: 1000
verbosity: debug
environment:
NEW_RELIC_API_KEY: "{{nrinfragent_env.NEW_RELIC_API_KEY }}"
NEW_RELIC_ACCOUNT_ID: "{{ nrinfragent_env.NEW_RELIC_ACCOUNT_ID }}"
http_proxy: "{{ proxy_env_redhat.http_proxy }}"
https_proxy: "{{ proxy_env_redhat.https_proxy }}"
and I can see the CLI called with the tag option with proxy value...
This brief AWS Linux instance demo shows it works as expected.
What is your OS?
redhat 8 ansible 2.9
Unfortunately, we don't support Ansible 2.9
ok! strange to be not aligned with an ansible version distributed for professional environment like RedHat!
We follow the non-EOL ansible version https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix
Thx all... l never really checked these stories of packages licenses etc now it's done
HI all
how can I setup proxy in /etc/newrelic-infra.yml ?
thanks