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

Make repo_url_suffix to be usable for RH/CentOS #174

Merged
merged 1 commit into from
Nov 17, 2015
Merged

Make repo_url_suffix to be usable for RH/CentOS #174

merged 1 commit into from
Nov 17, 2015

Conversation

tsde
Copy link
Contributor

@tsde tsde commented Nov 8, 2015

Hi,

This PR is intended to make the repo_url_suffix variable usable for RPM repos so that you can install NodeJS version 0.10 and above on RedHat based systems. The default value has been changed from "node_0.10" to "0.10". The suffix is then appended to repo URLs (node_suffix for Debian and pub_suffix for RedHat).

I also added some checks regarding the repo_url_suffix variable. There're still missing repos for some version of RedHat or Ubuntu on Nodesource, so I found it relevant to add these checks. Let me know if you find this addition useful or a pain to maintain ;) - I'll exclude this part from the PR in this case.

I've successfully tested this on Debian/Ubuntu and RedHat/CentOS.

Accepted values are as follows:

* Debian
* 0.10 (default)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what

@tsde
Copy link
Contributor Author

tsde commented Nov 8, 2015

Not sure what you meant by that. Unclear README info ? The main change is that repo_url_suffix now simply needs to reflect the version number without being preceded by "node_" which is only used by apt repos. For RPM repos, it's "pub_version_number". I tried to reflect all the valid settings in the README because some version of node are not yet available through nodesource repos for some OS releases. For example, there's still no 4.x and 5.x repo available at Nodesource for RedHat/CentOS 6. That's also the case, for some versions of Ubuntu.

Is there something wrong with the PR ?

@igalic
Copy link
Contributor

igalic commented Nov 9, 2015

i'm just wildly confused that 0.10 is the default anywhere…

@tsde
Copy link
Contributor Author

tsde commented Nov 9, 2015

Well, The current default behavior of the module is setting repo_url_suffix to "node_0.10" in params.pp. So, by default, it installs node version 0.10 on APT-based systems using the following repo URL schema: https://deb.nodesource.com/node_0.10.

Indeed you can change repo_url_suffix to "node_4.x" to install node version 4 on APT-based systems but what about RPM-based distros ? Currently, the RPM URL schema used in nodesource.pp is https://rpm.nodesource.com/pub/${dist_type}/${dist_version}/$basearch (for example https://rpm.nodesource.com/pub/el/7/x86_64 for RedHat 7). This endpoint only provides node version 0.10 which is why I proposed this PR so we can choose node version for RPM-based systems too. It simply uses pub_version instead of only pub.

Let me know

@juniorsysadmin
Copy link
Member

@tsde Would you be able to fix up the linting and RSpec tests? You can probably leave the default version number, as we'll need to bump the module version when that happens.

i'm just wildly confused that 0.10 is the default anywhere…

Um yeah, 0.12 was new at the time, then things were uncertain with the fork off to iojs, ...

@juniorsysadmin
Copy link
Member

Not strictly related but you might to double-check what happens with 4.x and the npm package and adjust the README accordingly (See #165 )

@tsde
Copy link
Contributor Author

tsde commented Nov 13, 2015

@juniorsysadmin Just fix the linting and added a check to ensure that $npm_package_ensure is set to absent when using Nodesource repositories. This should resolve #165. Also a default case clause has been added. Let me know if you find the changes acceptable.

I'm working at fixing rspec asap.

@juniorsysadmin
Copy link
Member

Just fix the linting and added a check to ensure that $npm_package_ensure is set to absent when using Nodesource repositories. This should resolve #165.

Just looked at the #165 again - npm_package_ensure already defaults to false for most operating systems and this I'll need to investigate that one further, so perhaps leave off the enforcement of npm_package_ensure.

Also, would it be more maintainable to move this logic (or some of it) to nodesource.pp rather than init.pp?

@tsde
Copy link
Contributor Author

tsde commented Nov 14, 2015

so perhaps leave off the enforcement of npm_package_ensure.

Ok, I've just reverted my changes on this. I think, we face the same kind of issue when you try to set to present the nodejs-dev package while using the Nodesource repos for Debian. As stated here, they don't use different packages for nodejs, nodejs-dev and npm. Everything is bundled into one package (for RedHat, it seems it's not the case for the devel package). Indeed, this'll need to be investigated further through a different PR.

I propose that this PR stays focused only on the ability to choose the node version for RedHat-based systems. I'm still working on fixing rspec at the meantime.

Also, would it be more maintainable to move this logic (or some of it) to nodesource.pp rather than init.pp?

Maybe. I'm used to put all class parameters checks into the init.pp file so checks happen earlier in the process. Not sure what Puppet recommends about this ?

@tsde
Copy link
Contributor Author

tsde commented Nov 14, 2015

@juniorsysadmin Just fixed the rspec tests. Let me know if everything seems fine (move checks to nodesource.pp or not ?)

@juniorsysadmin
Copy link
Member

Let me know if everything seems fine (move checks to nodesource.pp or not ?)

Up to you (could probably be done as another PR). You've updated some tests, and CI is green, so I'm okay with merging.

@juniorsysadmin juniorsysadmin added the enhancement New feature or request label Nov 16, 2015
@tsde
Copy link
Contributor Author

tsde commented Nov 16, 2015

@juniorsysadmin Great ! I'm OK with merging now. As you said, we can rethink checks placement in another PR

igalic added a commit that referenced this pull request Nov 17, 2015
Make repo_url_suffix to be usable for RH/CentOS
@igalic igalic merged commit 7411faf into voxpupuli:master Nov 17, 2015
@igalic
Copy link
Contributor

igalic commented Nov 17, 2015

aaand done! thanks @tsde!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants