第 2 章 管理 Puppet 模块
2.1. 在 Satellite 服务器上安装 Puppet 模块 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
您可以从 Puppet Forge 安装预构建的 Puppet 模块。Puppet Forge 是提供由社区贡献的 Puppet 模块的存储库。Puppet 模块标记为 受支持,Puppet Inc 已正式支持和测试。
本例演示了如何将 ntp 模块添加到 主机。
流程
-
导航到 forge.puppet.com 并搜索
ntp。第一个模块之一是 puppetlabs/ntp。 使用 SSH 连接到您的 Satellite 服务器并安装 Puppet 模块:
# puppet module install puppetlabs-ntp -i /etc/puppetlabs/code/environments/production/modules使用
-i参数指定路径和 Puppet 环境,如production。安装完成后,输出类似如下:
Notice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ... Notice: Created target directory /etc/puppetlabs/code/environments/production/modules Notice: Downloading from https://forgeapi.puppet.com ... Notice: Installing -- do not interrupt ... /etc/puppetlabs/code/environments/production/modules |-| puppetlabs-ntp (v8.3.0) |-- puppetlabs-stdlib (v4.25.1) [/etc/puppetlabs/code/environments/production/modules]
安装 Puppet 模块的一种替代方法是,将包含 Puppet 模块的文件夹复制到上述模块路径。确保手动解析其依赖项。