简体   繁体   English

带有一部分文件的人偶模板可编辑

[英]puppet template with a part of the file editable

I have a config file that I deploys by puppet, it's a template. 我有一个由人偶部署的配置文件,它是一个模板。 The program which is using this config file edit part of the file, which means that each puppet run replace the file. 使用此配置文件的程序会编辑文件的一部分,这意味着每个运行的木偶都会替换该文件。

Is it possible to declare a variable area not defined by puppet and which it can be edit? 是否可以声明一个不是puppet定义的变量区域,并且可以对其进行编辑?

In situations like this you should turn to augeas . 在这种情况下,您应该转向augeas It will allow puppet to only change config keys it knows about or wants to control instead of the entire file. 它将允许p只更改它知道或想要控制的配置密钥,而不是整个文件。 So you'd use the file resource to make sure the file exists, but not care about content. 因此,您将使用file资源来确保文件存在,但不关心内容。 And then use augeas to manage the portion of content you wish to control. 然后使用augeas管理您要控制的内容部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM