Replies: 2 comments 1 reply
-
Yes, your absolutely right, there is also a requirement of the minimum nodejs version that must be installed too to be checked before installing the agent |
Beta Was this translation helpful? Give feedback.
-
First time im playing with ansible today so this might be a dumb fix, but after having problems with the first agent setup i edited the _installAgent playbook to this and after that every agent has installed perfectly `
` |
Beta Was this translation helpful? Give feedback.
-
Would like SSM to automatically install NodeJS (+ any additional requirement) when installing new agents (while adding new devices).
Would that be possible?
I also found this kind of confusing when I started because the documentation mentions this:
But I couldn't make a new agent installation to work until I manually installed NodeJS in the device before adding it into SSM UI.
Here's the log with the error when you try to add a new device without NodeJS previously installed:
Starting... Using /server/src/ansible/ansible.cfg as config file PLAY [Install agent on targeted device] **************************************** TASK [Install agent on targeted device] **************************************** ok: [192.168.122.76] => { "msg": "Host ID 1880f949-4e20-45a7-bbca-f43d6f5931bc with API URL http://192.168.122.76:8000" } TASK [Check if NodeJS does exist] ********************************************** ok: [192.168.122.76] => {"changed": false, "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} TASK [Check if NPM does exist] ************************************************* ok: [192.168.122.76] => {"changed": false, "failed_when_result": false, "msg": "non-zero return code", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []} TASK [Install "PM2" node.js package globally.] ********************************* [WARNING]: Platform linux on host 192.168.122.76 is using the discovered Python interpreter at /usr/bin/python3.11, but future installation of another Python interpreter could change the meaning of that path. See https://docs.ansible.com/ansible- core/2.17/reference_appendices/interpreter_discovery.html for more information. fatal: [192.168.122.76]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3.11"}, "changed": false, "msg": "Failed to find required executable \"npm\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"} PLAY RECAP ********************************************************************* 192.168.122.76 : ok=3 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
This is my first attempt at using Ansible so I am not an expert at all in the subject... but the way I understand, the "_installAgent" playbook currently manage only the " PM2" dependency, so we would have to improve this playback to actually install NodeJS (from the official repo instead of your own linux distribution default packages) and anything else that could be missing.
I don't see this a bug and not sure if you want to add this "feature" so I am reporting it here as an idea.
Beta Was this translation helpful? Give feedback.
All reactions