【发布时间】:2015-08-11 00:37:50
【问题描述】:
我目前正在编写一个用于向 auto.misc 文件添加行的 puppet 模块。
我使用 augeas 向 auto.misc 文件添加了一个新条目,我想出了下面的内容,每次运行时它都运行良好而无需重复。
augeas { "new auto mountpoint":
context => "/files/etc/auto.misc",
changes => [
"set 01 'store'",
"set 01/opt[1] 'ro'",
"set 01/opt[2] 'soft'",
"set 01/opt[3] 'intr'",
"set 01/location/1/host 'uxkickstart.thenational.com'",
"set 01/location/1/path '/common'",
],
onlyif => "match *[. = 'store'] size == 0",
}
现在,如果我想为特定的挂载点添加新选项,它永远不会更新。
如果有人能告诉我最好的方法是什么,或者以不同的方式使用 augeas 来解决这里的问题,那就太好了。
谢谢
【问题讨论】: