【发布时间】:2015-10-16 10:19:03
【问题描述】:
我有下面的 dtp.conf 文件用于内部需求。
/opt/dtp/etc/dtp.conf
export CHO='NON-PROD'
但是当我通过augtool打印配置文件时无法打印值
/opt/pupet/bin/augtool
augtool> print /files/opt/dtp/etc/dtp_config
augtool>
【问题讨论】:
我有下面的 dtp.conf 文件用于内部需求。
/opt/dtp/etc/dtp.conf
export CHO='NON-PROD'
但是当我通过augtool打印配置文件时无法打印值
/opt/pupet/bin/augtool
augtool> print /files/opt/dtp/etc/dtp_config
augtool>
【问题讨论】:
我不记得 Augeas 对此文件有特定的镜头。 Augeas 无法猜测要使用哪个镜头(解析器),它需要知道哪个镜头与哪个文件相关联。
在这种情况下,这看起来像 Shellvar 类型的文件,因此您可以使用例如:
augtool -At "Shellvars.lns incl /opt/dtp/etc/dtp.conf"
编辑它。
在 Puppet 中,使用来自 augeasproviders_shellvar Puppet 模块的 shellvar 类型:
shellvar { 'CHO':
ensure => exported,
target => '/opt/dtp/etc/dtp_config',
value => 'NON-PROD',
}
【讨论】: