我做了一些定制模块。
这些自定义模块存储在我的R10K控制-回购中。因此,如果我运行R10K deploy environment,这些模块都是在/etc/puppetlabs/code/environments/MY_BRANCH/modules/中运行的。
现在我想使用来自Puppet的几个模块,所以我将它们添加到我的Puppetfile中,但是当我运行r10k puppetfile install时,模块目录将被完全清除,只剩下木偶伪造模块。
解决这个问题的最好办法是什么?
在此之前:
-modules/
-custom_facts/
-custom_files/之后:
-modules/
-certregen/
-inifile/所需:
-modules/
-custom_facts/
-custom_files/
-certregen/
-inifile/发布于 2017-07-07 18:08:31
对于Puppetfile中的模块安装,有一个不太知名的选项.这是local选项:https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#local。
您可以在您的true中将其设置为Puppetfile,以避免清除存储在控件repo中的模块:
mod 'custom_facts', local: true
mod 'custom_files', local: true在对上述Puppetfile进行修改后,用r10k deploy display进行验证,得到满意的结果。
注意,另一个选项是将本地模块移动到另一个模块目录中。例如:
repo root dir
|── Puppetfile
|── local_modules
| |── custom_facts
| |── custom_filesR10k将在模块部署期间忽略该目录(但不会在您的控件回购的环境部署期间),并且不会清除这些模块。但是,您需要设置您的enviroment.conf以查找该附加路径中的模块:environment.html#modulepath
https://stackoverflow.com/questions/44973466
复制相似问题