0

我在我的 redhat ec2 上遇到了 Augeas 的问题。我最近开始使用这个 API,到目前为止只用于/etc/目录的更改。

这是我使用的操作系统。

OS: Red Hat Enterprise Linux Server release 6.4 (Santiago)

我最近发现augtool 无法识别除/etc/ 和/boot/ 中的文件以外的任何文件。

例如:augtool> print /files/tmp/sample/test.cfg不会给出任何结果。

测试.cfg

[Credentials]
Keys = True

出于测试目的,我将此文件从 /tmp/ 移动到 /etc/httpd/conf.d/,但 augeas 仍然没有打印它的内容。它在哪里打印我的 apache 配置文件的配置树。

我试图把它们放在木偶中,这是我的代码:

augeas {"changeTest" :
  context => "/files/tmp/sample/test.cfg",
  changes => "set Credentials/Keys False"
}

这是我在 puppet 调试中看到的:

Debug: Augeas[changeTest](provider=augeas): sending command 'set' with params ["/files/tmp/sample/test.cfg/Credentials/Keys", "False"]
Debug: Augeas[changeTest](provider=augeas): Skipping because no files were changed

我在这里拧干什么呢?

4

1 回答 1

1

Augeas 不“识别”文件,也不知道这些文件的标准路径。/tmp 不是任何配置文件的标准位置,因此 augeas 不知道该做什么。

在 Puppet 中,您可以告诉 augeas 对给定文件使用哪个镜头(即解析器):

augeas {"changeTest" :
  incl => "/tmp/sample/test.cfg",
  lens => "Httpd.lns",
  changes => "set Credentials/Keys False",
}
于 2014-03-11T06:57:26.293 回答