Hi,
I have a playbook that uses the newrelic.newrelic-infra role for installing new relic. The playbooks just work fine when I manually run it.
This is the part of the playbook with the role we are using.
- name: Install New Relic
hosts: xxx
become: yes
roles:
- role: newrelic.newrelic-infra
vars:
nrinfragent_logging:
- name: httpd-logs
source_type: /var/log/httpd/error_log
source_value: FILE
custom_attributes:
application: xxx
service: httpd
logtype: httpd_error
log_file: /var/log/newrelic-infra/newrelic-infra.log
verbose: 0
nrinfragent_config:
license_key: xxxx
custom_attributes:
environment: dev
However, when I try to run the playbook through awx, it fails giving error
ERROR! couldn't resolve module/action 'win_chocolatey'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/runner/requirements_roles/newrelic.newrelic-infra/tasks/install_dist_pkgs.yml': line 143, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: install agent (windows)
^ here
The code that is mentioned in the error is
- name: install agent (windows)
win_chocolatey:
name: newrelic-infra
state: "{{ nrinfragent_state }}"
version: "{{ nrinfragent_choco_version | default(omit) }}"
when:
- nrinfragent_os_name == 'windows'
Ideally, awx should skip the task as it should be executed only on windows machine. But I’m having a RHEL machine, so it’s unable to find the win_chocolatey module. Can someone help me here on why awx doesn’t skip it when the manual playbook run is fine?
awx
Thanks