geerlingguy / ansible-role-nodejs

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

Error adding Nodesource repository for Node.js on Ubuntu 22.04 (Jammy) #164

Closed CorbaDigitpaint closed 3 months ago

CorbaDigitpaint commented 3 months ago

Hello Jeff!

We are using this ansible role (v7.0.0) to install Nodejs on a new Ubuntu 22.04 server, however we are consistently getting below error:


TASK [nodejs : Add NodeSource repositories for Node.js.] 
*************************************************************************************

failed: [<hostname>] (item=deb https://deb.nodesource.com/node_21.x jammy main) => {"ansible_loop_var": "item", "changed": false, "item": "deb https://deb.nodesource.com/node_21.x jammy main", "msg": "Failed to update apt cache: E:The repository 'https://deb.nodesource.com/node_21.x jammy Release' does not have a Release file., W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., W:https://nginx.org/packages/mainline/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details."}

failed: [<hostname>] (item=deb-src https://deb.nodesource.com/node_21.x jammy main) => {"ansible_loop_var": "item", "changed": false, "item": "deb-src https://deb.nodesource.com/node_21.x jammy main", "msg": "Failed to update apt cache: E:The repository 'https://deb.nodesource.com/node_21.x jammy Release' does not have a Release file., W:Updating from such a repository can't be done securely, and is therefore disabled by default., W:See apt-secure(8) manpage for repository creation and user configuration details., W:https://nginx.org/packages/mainline/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details."}

Is this some issue on our side, or is this something your can fix in a new version? Thanks in advance!

CorbaDigitpaint commented 3 months ago

Howdy!

I have to correct my previous comment. There is no issue with version 7.0.0 of your ansible role. Apparently I was still using version 6.0.0 even though my requirements.yml said v7.0.0. After running ansible-galaxy install -r requirements.yml --force I did not run into this issue anymore!