Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No option to disable the install of npm/nodejs #39

Open
TwizzyDizzy opened this issue May 19, 2017 · 7 comments
Open

No option to disable the install of npm/nodejs #39

TwizzyDizzy opened this issue May 19, 2017 · 7 comments
Assignees

Comments

@TwizzyDizzy
Copy link

TwizzyDizzy commented May 19, 2017

Hi folks,

I was just trying to use this role. We're only using it to install the application (Rocket.Chat) itself. Everything else (MongoDB, nginx, nodejs, npm) is managed by puppet.

So what I did was trying to be clever to prevent this role from installing nodejs-npm by setting

rocket_chat_dep_packages:
  - git
  - GraphicsMagick
  - wget
  - "@Development tools"

... and thereby explicitly excluding nodejs-npm. Yet, when running the playbook, it reveals that the playbook tries to install the package nodejs-npm and fails, because the version to be installed (nodejs-npm) conflicts with my already installed package nodejs and nodejs-npm from nodesource.com.

I suspect, that somewhere ansible (more specific: the yum provider) tries to install nodejs-npm via the results of something along the lines of yum provides node or yum provides npm.

Can I somehow prevent that? Did I describe the problem adequately?

Cheers
Thomas

@xenithorb
Copy link
Collaborator

Can you try this branch and let me know if anything changed? I have yet to merge that into master, but it did some significant changes to the way I handle installing the application with node. (namely I use the system node/npm to install nvm then get the right node version etc..)

@TwizzyDizzy
Copy link
Author

With your branch, the playbook fails at:

TASK [Rocket.Chat : assert] ****************************************************
task path: /home/thomas/Documents/git/ansible-chat-test/roles/Rocket.Chat/tasks/main.yml:27
fatal: [my.host.name]: FAILED! => {"failed": true, "msg": "ERROR! The conditional check 
'result|succeeded' failed. The error was: ERROR! template error while templating string: no filter named 'succeeded'"}

Cheers
Thomas

@TwizzyDizzy
Copy link
Author

TwizzyDizzy commented May 29, 2017

Oh well, this seems to be an ansible problem before 2.1. So I replaced succeeded with success and it now runs... up until the dependency installation.

Same problem. nodejs-npm is still being installed though it shouldn't be.

Cheers
Thomas

@xenithorb
Copy link
Collaborator

Should we still add the ability to not install npm and node through NVM?

One of the main points of contention I had with this role was in dealing with package'd node versions - and I say that as a Fedora packager - it's just not worth it with this stuff generally because of how rapid the development is.

That was the reasoning behind me ditching everything but the explicit version of NPM and Node that I specified in the defaults, because it always works. (Previously failures would occur depending on if packager versions could build a dependency or not)

I do my best to keep the npm and node versions that are installed by the role up-to-date with what upstream wants up to use. ........ One potential improvement would be to extract the package.json from the bundle early on, and simply use whatever version is there.

@xenithorb xenithorb self-assigned this Oct 22, 2017
@TwizzyDizzy
Copy link
Author

TwizzyDizzy commented Oct 26, 2017

Hi @xenithorb

Should we still add the ability to not install npm and node through NVM?

Oh... that was not my intention. The reason I opened this ticket is, that I was not able to prevent this role from trying to install nodejs. I didn't want to be able to install nodejs through this role. In fact, I wanted to prevent it.

But let me try to replicate this when I updated my environment to use the current version of this role. I'll then get back to you.

Cheers
Thomas

@aoyawale
Copy link

@TwizzyDizzy have you tried commenting out the tasks that install it?

@TwizzyDizzy
Copy link
Author

have you tried commenting out the tasks that install it?

That is my current workaround, yes.

Cheers
Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants