How to install a puppet file from a local repo with puppet module install

夙愿已清 提交于 2019-12-24 00:23:38

问题


another question around this problem.

is there a way the the puppet module install tool to install from a local repo I already downloaded to the disk?


回答1:


Unfortunately, no.

You can read the manual page for the puppet module face here. While there seems to be an option to specify private forges when installing modules, Puppetlabs' Forge API are not public, and Puppetlabs itself doesn't support any public or private application other than their Forge to build private repositories.

As an alternative, you could try librarian-puppet: https://github.com/rodjek/librarian-puppet.
It allows you to specify your module dependencies in a Puppetfile, also allowing to specify a Git repository as a source (so you can install also modules that are not in the Forge).




回答2:


You can use Puppet Library to host your own private Puppet Forge. It supports serving modules from disk, and proxying remote forges.

Start the server, pointing it to your downloaded modules

puppet-library --module-dir /my/downloaded/modules --port 8888

Add the following to puppet.conf to point it at your local module repository:

[main]
module_repository=http://localhost:8080/

Then, when you run puppet module install, the modules will be installed from the local repository. If you're using librarian-puppet can also point your Puppetfile at the local forge.




回答3:


This does not directly answer the question, but you can install puppet modules from a local file instead of using a local repo. Saves setting up extra stuff if this is a once a once off.

puppet module install ~/puppetlabs-apt-2.0.1.tar.gz --ignore-dependencies --force

The modules can be downloaded directly from puppet forge and saved to local storage.

ignore-dependencies is required if the module has dependancies that you have not installed yet.




回答4:


There seems to be only 3 options for hosting your own puppet forge server:

  • unibet/puppet-forge-server (opensource)
  • Pulp (opensource)
  • JFrog Artifactory (paid subscription, but so easy)

This page has a nice summary

Puppet has published their API

Note: I'm not related to any of the products above



来源:https://stackoverflow.com/questions/17571472/how-to-install-a-puppet-file-from-a-local-repo-with-puppet-module-install

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!