2015-10-16 13 views
0

我有下面的dtp.conf文件的內部要求。無法爲自己的配置打印augeas

/opt/dtp/etc/dtp.conf 

export CHO='NON-PROD' 

但是當我通過augtool無法打印配置文件打印值

/opt/pupet/bin/augtool 
augtool> print /files/opt/dtp/etc/dtp_config 
augtool> 

回答

1

我不記得有這個文件中的特定鏡頭Augeas。 Augeas無法猜測要使用哪個鏡頭(解析器),它需要知道將哪個鏡頭關聯到哪個文件。

在這種情況下,這看起來像一個Shellvar類型的文件,所以你可以使用例如爲:

augtool -At "Shellvars.lns incl /opt/dtp/etc/dtp.conf" 

進行編輯。

在木偶,從augeasproviders_shellvar木偶模塊使用shellvar類型:

shellvar { 'CHO': 
    ensure => exported, 
    target => '/opt/dtp/etc/dtp_config', 
    value => 'NON-PROD', 
} 
+0

我寫下面體現shellvar { 「出口CHO」: 確保=>本, 目標=>「/選擇/ DTP/etc/dtp_config「, value =>」非prod「但出現錯誤」SERVER上的錯誤400:Puppet :: Parser :: AST :: Resource失敗,錯誤ArgumentError:資源類型無效/ etc/puppetlabs/puppet/modules/example/manifests/dtp.pp:14 on node「augtool version is 1.3.0 – Puppeteer

+0

此更新 – Puppeteer

+0

我用shellvar代碼更新了答案。 –