首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >傀儡中的augeas不更改文件。

傀儡中的augeas不更改文件。
EN

Stack Overflow用户
提问于 2016-07-06 07:23:59
回答 1查看 678关注 0票数 0

我想使用来自木偶的Augeas来管理carbon.conf文件的内容。我以前在Puppet中使用了Augeas来管理xml文件,这非常有效。

然而,这次应用木偶目录时,carbon.conf文件不会发生任何变化。日志中也没有错误。下面是我在傀儡清单文件中的代码:

代码语言:javascript
复制
augeas { 'cache config':
  notify  => Service[carbon-cache],
  incl    => '/opt/graphite/conf/carbon.conf',
  context => '/cache',
  lens    => 'Carbon.lns',
  changes => [
    "set UDP_RECEIVER_PORT 2013",
    "set LINE_RECEIVER_PORT 2013",
    "set PICKLE_RECEIVER_PORT 2014",
  ];
}

在调试日志中,我可以看到以下内容:

代码语言:javascript
复制
Debug: Augeas[cache config](provider=augeas): Opening augeas with root /, lens path /var/lib/puppet/lib/augeas/lenses, flags 64
Debug: Augeas[cache config](provider=augeas): Augeas version 1.0.0 is installed
Debug: Augeas[cache config](provider=augeas): Will attempt to save and only run if files changed
Debug: Augeas[cache config](provider=augeas): sending command 'set' with params ["/cache/UDP_RECEIVER_PORT", "2013"]
Debug: Augeas[cache config](provider=augeas): sending command 'set' with params ["/cache/LINE_RECEIVER_PORT", "2013"]
Debug: Augeas[cache config](provider=augeas): sending command 'set' with params ["/cache/PICKLE_RECEIVER_PORT", "2014"]
Debug: Augeas[cache config](provider=augeas): Skipping because no files were changed
Debug: Augeas[cache config](provider=augeas): Closed the augeas connection

我在这里错过了什么?

我还注意到,在从命令行使用augtool时,ls /files/命令只列出以下文件夹

代码语言:javascript
复制
augtool> ls /files/
etc/ = (none)
usr/ = (none)
boot/ = (none)

我也希望在这里看到/opt ..。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-07-06 07:31:03

上下文需要包含到相对路径所需的基节点的完整路径。在您的例子中,我猜您希望上下文成为/files/opt/graphite/conf/carbon.conf/cache

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38218350

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档