【问题标题】:augeas not recognizing file in tmp directoryaugeas 无法识别 tmp 目录中的文件
【发布时间】:2014-03-11 04:29:58
【问题描述】:

我在我的 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 不会给出任何结果。

test.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

我在做什么?

【问题讨论】:

    标签: amazon-ec2 puppet rhel augeas


    【解决方案1】:

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

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

    augeas {"changeTest" :
      incl => "/tmp/sample/test.cfg",
      lens => "Httpd.lns",
      changes => "set Credentials/Keys False",
    }
    

    【讨论】:

    猜你喜欢
    • 2019-05-29
    • 2014-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-10
    • 1970-01-01
    • 2015-07-05
    相关资源
    最近更新 更多