无法为自己的配置打印 augeas

unable to print augeas for own configuration

我有以下 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',
}