可以从网络中获得模板
https://forge.puppet.com/ http://www.example42.comLinux 下使用命令行获得模块方法
(默认会从 https://forge.puppet.com/ 获取 )
[root@hh-yun-puppet-129021 modules]# puppet module search squid Warning: Setting modulepath is deprecated in puppet.conf. See http://links.puppetlabs.com/env-settings-deprecations (at /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1095:in `issue_deprecations') Notice: Searching https://forgeapi.puppetlabs.com ... NAME DESCRIPTION AUTHOR KEYWORDS puppet-squid configure squid caching proxy @puppet squid cache http web CERNOps-shoal Shoal publishes http proxy locations @CERNOps shoal cvmfs frontier squid thias-squid3 Squid 3 http proxy server module @thias squid proxy desalvo-frontier Puppet module for Frontier configuration @desalvo frontier squid cvmfs有时候, 由于具有模块依赖关系, 需要添加参数 –ignore-dependencies 才能够正常进行下载
[root@hh-yun-puppet-129021 modules]# puppet module install --ignore-dependencies elasticsearch-elasticsearch Warning: Setting modulepath is deprecated in puppet.conf. See http://links.puppetlabs.com/env-settings-deprecations (at /usr/lib/ruby/site_ruby/1.8/puppet/settings.rb:1095:in `issue_deprecations') Notice: Preparing to install into /etc/puppet/modules ... Notice: Downloading from https://forgeapi.puppetlabs.com ... Notice: Installing -- do not interrupt ... /etc/puppet/modules └── elasticsearch-elasticsearch (v0.12.0)默认状态下, 从网络下载的模块会自动被放置 /etc/puppet/modules 目录下 同样, 假如手动下载了 tar 包之后, 可以直接解压至少 /etc/puppet/modules 目录下即可
用户可以创建个性化的模块 模块同样需要存放在 /etc/puppet/modules 目录下
常见的模块目录下, 通常包含下面几个目录 . ├── files 存放共享文件, 常常以 puppet:///modulename/modules/filename 格式进行定义 ├── lib 存放 ruby 代码, 定义了 puppet 的一些方法 ├── manifests 存放了该模块的 pp 模板, 用于定义该模板的主要功能 ├── spec 存放编译方法, 可以通过 puppet modules build 的方法生成新的 puppet modules └── templates 存放模板, 定义了用户模板, 可以通过模板生成格式化的配置文件
