在Chef recipe

时间:2015-08-27 12:35:11

标签: ruby amazon-ec2 chef

我想通过chef-recipe执行以下命令,我需要安装软件,

sudo apt-get install autoconf autogen intltool,  
sudo apt-get install build-essential libtool    
sudo apt-get install apache2-threaded-dev  
sudo apt-get install pkg-config    
sudo apt-get install libcurl4-gnutls-dev

当我在食谱中尝试以下方式时出现错误

execute "Build oauth" do  
 command "cd /home/ubuntu/mod_auth_openidc-1.8.0;sudo apt-get install autoconf autogen intltool;sudo apt-get install build-essential libtool"  
end

错误是

  

ec2-52-27-144-189.us-west-2.compute.amazonaws.com Ran cd   / home / ubuntu / mod_auth_o penidc-1.8.0; sudo apt-get install autoconf   autogen intltool; sudo apt-get install build-essential libtool   返回1 ec2-52-27-144-189.us-west-2.compute.amazonaws.com   [2015-08-27T11:24:49 + 00:00] FA TAL:   Chef :: Exceptions :: ChildConvergeError:退出Chef运行进程   notccessfull y(退出代码1)

请指导我完成这个

1 个答案:

答案 0 :(得分:1)

关注@Tensibai的建议。利用厨师的package resouce

不要使用难以解释错误的“执行”资源(只返回代码)而不是idpotent(意味着你不能重复运行你的食谱)

answer file "Select a video..."
if it is not empty then
  set the filename of player 1 to it
  set the currentTime of player 1 to 0
end if