2015-01-15 32 views
0

一個新條目我嘗試創建hosts.allow中無法使用augeas建立在hosts.allow中

augeas { "Add in hosts allow" : 
     context => '/files/etc/hosts.allow', 
     changes => [ 
     'ins 01 after *[last()]', 
     'set 01/process[1] ssh', 
     'set 01/process[2] ssh2', 
     'set 01/client ipaddr' 
     ], 
    } 

一個新條目,但它不工作,我得到這個錯誤

Notice: Compiled catalog for server.local in environment production in 0.96 seconds 
Error: /Stage[main]/Nfs::Server/Augeas[Add in hosts allow]: Could not evaluate: Error sending  
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"]/Error sending 
command 'ins' with params ["01", "after", "/files/etc/hosts.allow/*[last()]"] 

我看不到如何使用ins命令,該消息不讓我知道出了什麼問題。

CentOS6.4

木偶版本:3.3.1

augeasversion(從facter):0.9.0

我找不到augtools的版本,我也不能執行一個命令,因爲它沒有安裝(我不知道如何木偶調用它)

+0

木偶哪個版本,Augeas的版本,以及OS?另請提供「augtool print /augeas/files/etc/hosts.allow」輸出。 –

+0

您可以運行「yum install augeas」來安裝augtool。 –

+0

我認爲你應該嘗試將augeas-libs軟件包升級到CentOS 6的最新版本(1.0.0-something),因爲這個文件有很多bug修復。 –

回答

1

嘗試添加一個前導「/」的上下文?

(該記錄是有點奇怪,它並沒有顯示「文件」前綴可言,我不知道您的代碼示例和記錄比賽。)

+0

我做了更改和消息幾乎相同。我編輯conf並編輯消息。 –