Jas*_*nes 3 linux bash puppet augeas
augtool
Augeas接缝是 Puppet 修改配置文件的流行程序,但是如何修改augtool
没有镜头的配置文件?例如:
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Compiz
Exec=compiz
NoDisplay=false
# name of loadable control center module
X-GNOME-WMSettingsModule=metacity
Run Code Online (Sandbox Code Playgroud)
在这个特定的例子中,我想更改NoDisplay
为true
.
题
是否可以在没有镜头的情况下修改配置文件?可以augtool
尝试猜测配置文件的树结构吗?
Augeas 无法猜测要使用哪个镜头。例如,在一个桌面文件(你的例子)的情况下,可以使用许多镜头(MySQL.lns
,PHP.lns
,等),但他们每个人将引入的限制,将无法与桌面格式兼容。
在您的情况下,您想使用 Desktop.lns
镜头:
$ augtool --autosave --noautoload --transform "Desktop.lns incl /path/to/your/example.desktop" set "/files/path/to/your/example.desktop/Desktop Entry/NoDisplay" true
Run Code Online (Sandbox Code Playgroud)