newrelic / ansible-install

Building installation support for our customers are using ansible to manage their infrastructure and services at scale
Apache License 2.0
8 stars 6 forks source link

Even though install_timeout_seconds is not defined it still gives an error #41

Closed mramadan-modernise closed 1 year ago

mramadan-modernise commented 1 year ago

Description

Steps to Reproduce

given the below playbook

---
- name: Install New Relic infrastructure and logs
  hosts: all
  roles:
  - role: newrelic.newrelic_install
  vars:
    targets:
    - infrastructure
    verbosity: debug
  environment:
    NEW_RELIC_API_KEY: '...'
    NEW_RELIC_ACCOUNT_ID: '...'
    NEW_RELIC_REGION: US

Got the following error:

fatal: [app]: FAILED! => {"msg": "The conditional check 'install_timeout_seconds is not defined or install_timeout_seconds is integer' failed. The error was: template error while templating string: no test named 'integer'. String: {% if install_timeout_seconds is not defined or install_timeout_seconds is integer %} True {% else %} False {% endif %}"}

Expected Behavior

Validation is passed and agent is installed

Relevant Logs / Console output

fatal: [app]: FAILED! => {"msg": "The conditional check 'install_timeout_seconds is not defined or install_timeout_seconds is integer' failed. The error was: template error while templating string: no test named 'integer'. String: {% if install_timeout_seconds is not defined or install_timeout_seconds is integer %} True {% else %} False {% endif %}"}

Your Environment

rthorn-nr commented 1 year ago

Hi @mramadan-modernise , thank you for raising this issue.

I'm unable to repro using Ansible v2.12.10 on RHEL -- would you please run ansible --version and cat /etc/os-release and share the full output (or otherwise share your OS info)?

mramadan-modernise commented 1 year ago

Hey @rthorn-nr ,

Thanks for your response. I am using a windows machine and running the ansible commands from the WSL 2.

HYG the outputs for the commands

$ ansible --version
ansible [core 2.12.10]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/mrb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/mrb/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.8.10 (default, Nov 14 2022, 12:59:47) [GCC 9.4.0]
  jinja version = 2.10.1
  libyaml = True
$cat /etc/os-release

NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
rthorn-nr commented 1 year ago

Hi @mramadan-modernise , apologies that it has taken so long to get back to you on this. I was able to reproduce this error with the information you provided. Thank you again for bringing this to our attention!

We've had some internal conversations about what systems we are able to support. Because the infrastructure agent requires systemd, it is not supported on-host in WSL 1/2. Since the infra agent is a requirement for our logs and other on-host integrations, and additionally because we have not been able to reproduce this issue in non-WSL Linux containers, we regretfully are moving forward with the assumption that ansible-install does not support WSL. This may be subject to change in the future.

In the meantime, I'd recommend looking into the Docker install for the infra agent. It can be run from WSL 2 as long as WSL is enabled in Docker Desktop (> Settings > General). You can find the command to spin up the infra agent container in NR1 under Add Data > Guided Install > Docker.