2015-04-17 79 views
0

我一直在使用Puppet來自動化我們的部署過程。我們使用Ant工具將代碼部署到Tomcat服務器,並且我正在嘗試開發這種東西的清單在Puppet的exec資源中指定正確的搜索路徑

Puppet無法識別路徑變量中提到的命令,我可以手動運行我的ant命令,它位於/選擇/軟件/螞蟻/斌/螞蟻。

這是我面臨的

exec { "ant themes": 
    command => "ant build-themes", 
    cwd => "/opt/liferay6/portal/portal-web", 
    path => [ "/usr/bin", "/bin", "/opt/softwares/ant/bin/ant" ], 
    } 


Notice: Compiled catalog for liferay in environment production in 0.04 seconds 
Notice: /Stage[main]/Main/Exec[ant themes]/returns: current_value notrun, should be 0 (noop) 
Notice: Class[Main]: Would have triggered 'refresh' from 1 events 
Notice: Stage[main]: Would have triggered 'refresh' from 1 events 
Notice: Finished catalog run in 13.63 seconds 
[email protected]:~/puppet/modules/liferay6/manifests$ sudo puppet apply 1.pp 
Notice: Compiled catalog for liferay in environment production in 0.04 seconds 
Error: Could not find command 'ant' 
Error: /Stage[main]/Main/Exec[ant themes]/returns: change from notrun to 0 failed: Could not find command 'ant' 
Notice: Finished catalog run in 13.59 seconds 

請告知克服這個問題的錯誤。

回答

2

您對搜索路徑的使用不正確。

而不是

/opt/softwares/ant/bin/ant 

你需要指定

/opt/softwares/ant/bin 

使得ant命令在該目錄中找到。

+0

嗨菲利克斯弗蘭克...感謝您的快速回復,並指導我解決上述問題.. –

+0

@anilkottam肯定。如果這解決了您的問題,請隨時上傳和/或接受答案。 –