Wrap Package in a define

41 views
Skip to first unread message

Brian Wilkins

unread,
Jul 18, 2014, 8:32:02 AM7/18/14
to puppet...@googlegroups.com
Hello,

We are trying to use the puppet-forge graphite module located here: https://github.com/echocat/puppet-graphite/blob/master/manifests/install.pp and our servers will not have access to the Internet. So we are downloading all the pip packages to a local repository and will point pip to each package. I would like to wrap the Package type so I can provide the source. How would I do this so that the package name is passed to the defined type? My intent is to not change much of the code here: https://github.com/echocat/puppet-graphite/blob/master/manifests/install.pp

Otherwise, I will have to comment out alot of the manifest and replace with exec statements pointing to each individual package.


David Schmitt

unread,
Jul 21, 2014, 5:53:01 AM7/21/14
to puppet...@googlegroups.com

Hi Brian,
As far as I understand the current pip provider code, it won't work
anyways without access to the pypi repository.

Since pip provides a way to globally configure a different index, I
think that would be a much better way to achieve your goal:

> http://pip.readthedocs.org/en/latest/user_guide.html#configuration

From a cursory glance over the possibilities, setting an environment
variable to override your index location might be another way to avoid
poisoning the global pip config.


Regards, David
--
* Always looking for people I can help with awesome projects *
G+: https://plus.google.com/+DavidSchmitt
Blog: http://club.black.co.at/log/
LinkedIn: http://at.linkedin.com/in/davidschmitt

Brian Wilkins

unread,
Jul 21, 2014, 2:25:55 PM7/21/14
to puppet...@googlegroups.com
Thanks David. We have taken the route of downloading the necessary dependencies and then explicitly setting the source for each package statement. We have an FTP server for our yum repo so we just added a pip directory and provide the ftp:// URL to pip. That seems to work.

Jason Antman

unread,
Jul 30, 2014, 8:59:20 AM7/30/14
to puppet...@googlegroups.com
For future reference...
(1) if at all possible (I assume you did this) hacking up upstream modules is bad
(2) I'd use pip2pi (https://github.com/wolever/pip2pi) to create a mirror of the modules you want, and then have puppet manage /root/.pip/pip.conf (assuming puppet is running as root) and set:
[global]
index-url = /path/to/mirror



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f24ebad4-f27d-41aa-978a-33ca56a9b541%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages