我正在使用R10K来管理我的配置文件。
我想使用 Puppet 文件在我的主服务器上安装一个 puppet 模块。
我转到分支并将以下内容添加到Puppetfile
:
mod 'puppetlabs-certregen', '0.2.0'
然后我在服务器上运行puppet agent -t
。该命令似乎很成功,因为我的清单中的命令已运行,但是当我puppet certregen healthcheck
运行时,该模块似乎没有安装。
使用木偶文件安装模块的正确方法是什么?
Puppetfile 类似于 Ruby Gemfile,Python 需求.txt:它列出了依赖项,然后由单独的工具安装。
对于 Puppetfiles,这是 r10k。
它记录在这里 https://puppet.com/docs/pe/2018.1/puppetfile.html
您也可以使用命令行直接下载模块:
puppet module install puppetlabs-certregen
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/Users/petersouter/.puppetlabs/etc/code/modules
└─┬ puppetlabs-certregen (v0.2.0)
└── puppetlabs-stdlib (v4.17.1)
但是请注意,r10k 和puppet module install
不能很好地配合使用:
限制:如果您使用的是代码管理器或 r10k,请不要使用
puppet module
命令安装、更新或卸载模块。使用代码管理,您必须使用Puppetfile安装模块。代码管理清除使用 puppet 模块命令安装的模块。有关说明,请参阅 Puppetfile 文档。