ansible-role-nodejs icon indicating copy to clipboard operation
ansible-role-nodejs copied to clipboard

Allow to specify exact nodejs version to install

Open piotrkochan opened this issue 3 years ago • 4 comments

By default, ansible-role-nodejs always installs latest nodejs version. Actually, it upgrades it to the latest version on every run which may cause some problems in production environment.

This PR adds the option to choose the exact nodejs version to install. It doesn't change default behavior of the role.

piotrkochan avatar May 24 '22 12:05 piotrkochan

@geerlingguy, can we merge this code? Thanks 🙏🏻 I would like to support node v16

diogopms avatar Aug 16 '22 20:08 diogopms

Wouldn't just adding something like nodejs_version: '16.15.0-' work here? since the other task includes the * and only replaces x in the version string?

geerlingguy avatar Aug 17 '22 14:08 geerlingguy

It is possible to extract major version from the nodejs_version, glue additional .x and use it to configure the repository.

piotrkochan avatar Aug 17 '22 14:08 piotrkochan

Could it be done also for the redhat part? Wouldn't something like this be enough?

  • name: Ensure Node.js and npm are installed. yum: name: "nodejs-{{ nodejs_exact_version|default(nodejs_version|regex_replace('x', '')) }}*" state: present enablerepo: nodesource

nad56 avatar Sep 15 '22 13:09 nad56

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

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

stale[bot] avatar Dec 21 '22 06:12 stale[bot]

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

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

stale[bot] avatar Apr 02 '23 07:04 stale[bot]

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

stale[bot] avatar May 21 '23 13:05 stale[bot]