在Puppet'中指定正确的搜索路径;s执行资源

在Puppet'中指定正确的搜索路径;s执行资源,puppet,Puppet,我一直在研究Puppet,以实现部署过程的自动化。我们使用Ant工具将代码部署到Tomcat服务器中,我正在尝试为这些东西开发清单 Puppet无法识别path变量中提到的命令,我可以在/opt/softwares/ant/bin/ant中手动运行ant命令 这就是我面临的错误 exec { "ant themes": command => "ant build-themes", cwd => "/opt/liferay6/portal/portal-web", p

我一直在研究Puppet,以实现部署过程的自动化。我们使用Ant工具将代码部署到Tomcat服务器中,我正在尝试为这些东西开发清单

Puppet无法识别path变量中提到的命令,我可以在/opt/softwares/ant/bin/ant中手动运行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
vidyayug@liferay:~/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

请建议解决此问题。

您使用的搜索路径不正确

而不是

/opt/softwares/ant/bin/ant
您需要指定

/opt/softwares/ant/bin

这样就可以在该目录中找到
ant
命令。

Hi Felix Frank。。。感谢您的快速回复,并指导我解决上述问题。@Anilkott我确信。如果这解决了你的问题,请随意投票和/或接受答案。