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

nodejs/manifests/params.pp installs /etc/yum.repos.d/nodejs-stable.repo which doesn't work with Scientific Linux 6.4 #38

Closed
stefanlasiewski opened this issue Jul 11, 2013 · 2 comments

Comments

@stefanlasiewski
Copy link

nodejs/tests/init.pp fails on my Scientific Linux 6.4 boxes with the following error:

root@sl6:~ # puppet apply /etc/puppet/modules/nodejs/tests/init.pp
Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install nodejs-compat-symlinks' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: nodejs-stable. Please verify its path and try again

Error: /Stage[main]/Nodejs/Package[nodejs]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install nodejs-compat-symlinks' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: nodejs-stable. Please verify its path and try again

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install npm' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: nodejs-stable. Please verify its path and try again

Error: /Stage[main]/Nodejs/Package[npm]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install npm' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: nodejs-stable. Please verify its path and try again

This issue arises from the following code in nodejs/manifests/params.pp:

  $baseurl  = 'http://patches.fedorapeople.org/oldnode/stable/el$releasever/$basearch/'

On RHEL & CentOS, $releasever will return a single digit like '6', and thus the repo above will point to something like http://patches.fedorapeople.org/oldnode/stable/el6/x86_64/ .

However, on Scientific Linux, $releasever is often something like 6x or 6.4:

root@sl6:~ # python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Loaded plugins: fastestmirror, priorities
{'arch': 'ia32e',
 'basearch': 'x86_64',
 'releasever': '6.4',
 'uuid': 'a7d2547c-c95c-4577-88e8-eb0b18c89101'}

Therefore, the URL will turn out to be something like http://patches.fedorapeople.org/oldnode/stable/el6.4/x86_64/, which doesn't exist.

For now, a workaround is to manually modify /etc/puppet/modules/nodejs/manifests/params.pp & replace $releasever with '6', but this only works for a limited number of cases.

I am still familiarizing myself with Puppet and I am unsure how to fix this. However, the commit to puppet-yum (see link [1]) might have a solution. He make use of the $yum::osver & $common::osver variables:

-        baseurl => 'http://yum.puppetlabs.com/el/$releasever/dependencies/$basearch',
+        baseurl => "http://yum.puppetlabs.com/el/$common::osver/dependencies/\$basearch", 

[1] example42/puppet-yum@764ee1b .

@brettporter
Copy link

I'd recommend not turning on manage_repo, and use EPEL instead. See #24 (comment) for more details.

@juniorsysadmin
Copy link
Member

This module should now work without dramas using the EPEL package or the packages from NodeSource. If it doesn't, feel free to open a new issue.

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

No branches or pull requests

3 participants