为什么配置文件不应该与Chef / Puppet逐行更改? [英] Why config files should't be changed line-by-line with Chef / Puppet?

查看:222
本文介绍了为什么配置文件不应该与Chef / Puppet逐行更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在Chef或Puppet中配置文件中的行被认为是反模式?
这是一个像坏习惯,我明白了。我假设这个文件编辑是以某种幂等方式和高级工具(例如augeas)完成的。

Why is changing lines in configuration file considered an anti-pattern in Chef or Puppet? It's something like bad habit, as I understood. I assume that this file-editing is done in some idempotent way and with advanced tools (augeas for example).

为什么部署整个文件,使用ERB模板首选方法?

Why is deploying the whole files, with ERB templates, considered a preferred method?

您可以找到很多示例,其中dev-ops建议使用模板而不是文件编辑。例如,此处此处此处

You can find a lot of examples where dev-ops are suggesting usage of templates instead of file-editing. For example here, here, here, etc.

推荐答案

实际上,DevOps社区有很大一部分看到接受配置文件的系统/包默认值,只通过 augeas 首选方法,Github devops将是其中之一(如果你碰巧捕捉他们在Puppet Conf 2012)。

Actually there is a large part of the DevOps community that sees accepting system/package defaults for config files and only modifying what you need through augeas as the preferred method, Github devops would be one of them(if you happened to catch them at Puppet Conf 2012).

我认为有一个默认模式总是使用模板高昂的维护负载,并且几乎总是需要锁定在堆栈中的所有内容的特定版本,否则您有可能对该资源的较新版本使用不兼容的模板。

I think having a default pattern of always using templates creates too high of a maintenance load and almost always requires you lock in specific versions for everything across your stack or you risk having an incompatible template against a newer version of that resource.

两个选项的使用案例,但一般来说,我赞成自己尽可能的练习vs自己的一切,即使你不必练习。

There's use cases for both options but in general I favor the "own as little as possible" practice vs the "own everything even if you don't have to" practice.

这篇关于为什么配置文件不应该与Chef / Puppet逐行更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆