geerlingguy / ansible-role-nodejs

Ansible Role - Node.js
https://galaxy.ansible.com/geerlingguy/nodejs/
MIT License
410 stars 252 forks source link

Installation via Tower/AWX #134

Closed Webguyatwork closed 2 years ago

Webguyatwork commented 2 years ago

This took me forever to figure out, so I'm hoping it helps someone in the future. Running the Ansible installation from the command line was pretty smooth after installing the requirements.yml through ansible-galaxy. However, when I added the playbook into AWX as-is, it threw errors on the additional role requirement for geerlingguy.nodejs.

First off, the requirements.yml in the root of the project is not where AWX expects to see it. Once I corrected its location to work within AWX, there was yet another missing required collection for npm.

Here is all I needed to do to enable the playbook to run under Tower/AWX:

  1. Move requirements.yml from the root folder and into the roles folder. The contents were otherwise untouched.
  2. Create a collections folder with its own requirements.yml file with the following content:
---
collections:
  - name: community.general

Without the additional collection added, I would get this error:

ERROR! couldn't resolve module/action 'npm'. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in '/runner/requirements_roles/geerlingguy.nodejs/tasks/main.yml': line 28, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- name: Ensure npm global packages are installed.
  ^ here
stale[bot] commented 2 years ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 2 years ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.

RangerMauve commented 3 months ago

Getting this still