我正在尝试使用 Puppet 设置 Windows CFG 文件的配置。
augeas{ "bbdisplay_setting":
incl => '/tmp/BBWin.cfg',
lens => "Xml.lns",
# How do I change the value of `value=1.1.1.1 to value=9.9.9.9
}
在此示例 XML 文件中,我找不到如何更改第一个 bbdisplay 值的好示例:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<bbwin>
<setting name="bbdisplay" value="1.1.1.1" />
<setting name="bbdisplay" value="2.2.2.2" />
</bbwin>
</configuration>
Augtool 将配置列为:
/files
/files/tmp
/files/tmp/BBWin.cfg
/files/tmp/BBWin.cfg/#declaration
/files/tmp/BBWin.cfg/#declaration/#attribute
/files/tmp/BBWin.cfg/#declaration/#attribute/version = "1.0"
/files/tmp/BBWin.cfg/#declaration/#attribute/encoding = "utf-8"
/files/tmp/BBWin.cfg/configuration
/files/tmp/BBWin.cfg/configuration/#text = "\n "
/files/tmp/BBWin.cfg/configuration/bbwin
/files/tmp/BBWin.cfg/configuration/bbwin/#text[1] = "\n"
/files/tmp/BBWin.cfg/configuration/bbwin/setting[1] = "#empty"
/files/tmp/BBWin.cfg/configuration/bbwin/setting[1]/#attribute
/files/tmp/BBWin.cfg/configuration/bbwin/setting[1]/#attribute/name = "bbdisplay"
/files/tmp/BBWin.cfg/configuration/bbwin/setting[1]/#attribute/value = "1.1.1.1"
/files/tmp/BBWin.cfg/configuration/bbwin/#text[2] = " "
/files/tmp/BBWin.cfg/configuration/bbwin/setting[2] = "#empty"
/files/tmp/BBWin.cfg/configuration/bbwin/setting[2]/#attribute
/files/tmp/BBWin.cfg/configuration/bbwin/setting[2]/#attribute/name = "bbdisplay"
/files/tmp/BBWin.cfg/configuration/bbwin/setting[2]/#attribute/value = "2.2.2.2"
/files/tmp/BBWin.cfg/configuration/bbwin/#text[3] = " "