我想使用来自木偶的Augeas来管理carbon.conf文件的内容。我以前在Puppet中使用了Augeas来管理xml文件,这非常有效。
然而,这次应用木偶目录时,carbon.conf文件不会发生任何变化。日志中也没有错误。下面是我在傀儡清单文件中的代码:
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",
];
}在调试日志中,我可以看到以下内容:
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/命令只列出以下文件夹
augtool> ls /files/
etc/ = (none)
usr/ = (none)
boot/ = (none)我也希望在这里看到/opt ..。
发布于 2016-07-06 07:31:03
上下文需要包含到相对路径所需的基节点的完整路径。在您的例子中,我猜您希望上下文成为/files/opt/graphite/conf/carbon.conf/cache
https://stackoverflow.com/questions/38218350
复制相似问题