2014-07-02 28 views
0

我使用Chef Solo在12.04 Ubuntu上使用Vagrant運行。我如何獲得鑰匙與廚師的apt cookbook合作

的PPA回購:https://launchpad.net/~chris-lea/+archive/postgresql-9.3 貼切coookbook:https://github.com/opscode-cookbooks/apt

下面是關於部分從我的食譜。

apt_repository 'postgresql-9.3' do 
    uri   'http://ppa.launchpad.net/chris-lea/postgresql-9.3/ubuntu' 
    distribution 'precise' 
    components ['main'] 
    keyserver 'keyserver.ubuntu.com' 
    key   'D878D6C2' 
    deb_src  true 
end 

execute 'apt-key-update' do 
    command 'sudo apt-key update' 
end 

execute 'apt-update' do 
    command 'sudo apt-get update --fix-missing' 
end 

package 'zsh' do 
    action :install 
end 

package 'postgresql-9.3' do 
    action :install 
end 

而這裏的錯誤:

==> default: [2014-07-02T15:23:52+00:00] INFO: Running queued delayed notifications before re-raising exception 
==> default: [2014-07-02T15:23:52+00:00] ERROR: Running exception handlers 
==> default: [2014-07-02T15:23:52+00:00] ERROR: Exception handlers complete 
==> default: [2014-07-02T15:23:52+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out 
==> default: [2014-07-02T15:23:52+00:00] ERROR: package[postgresql-9.3] (dotabay::default line 22) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '100' 
==> default: ---- Begin output of apt-get -q -y install postgresql-9.3=9.3.3-1chl1~precise1 ---- 
==> default: STDOUT: Reading package lists... 
==> default: Building dependency tree... 
==> default: Reading state information... 
==> default: The following extra packages will be installed: 
==> default: libpq5 postgresql-client-9.3 postgresql-client-common postgresql-common 
==> default: ssl-cert 
==> default: Suggested packages: 
==> default: oidentd ident-server locales-all postgresql-doc-9.3 openssl-blacklist 
==> default: The following NEW packages will be installed: 
==> default: libpq5 postgresql-9.3 postgresql-client-9.3 postgresql-client-common 
==> default: postgresql-common ssl-cert 
==> default: 0 upgraded, 6 newly installed, 0 to remove and 167 not upgraded. 
==> default: Need to get 4,804 kB of archives. 
==> default: After this operation, 23.1 MB of additional disk space will be used. 
==> default: WARNING: The following packages cannot be authenticated! 
==> default: libpq5 postgresql-client-common postgresql-client-9.3 postgresql-common 
==> default: postgresql-9.3 
==> default: STDERR: E: There are problems and -y was used without --force-yes 
==> default: ---- End output of apt-get -q -y install postgresql-9.3=9.3.3-1chl1~precise1 ---- 
==> default: Ran apt-get -q -y install postgresql-9.3=9.3.3-1chl1~precise1 returned 100 
==> default: [2014-07-02T15:23:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) 
Chef never successfully completed! Any errors should be visible in the 
output above. Please fix your recipes so that they properly complete. 

Vagrantfile

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| 
    config.vm.box = "hashicorp/precise64" 
    config.vm.network "forwarded_port", guest: 80, host: 8080 
    config.omnibus.chef_version = :latest 
    config.vm.provision "chef_solo" do |chef| 
    chef.cookbooks_path = ["chef/cookbooks"] 
    chef.add_recipe 'apt' 
    chef.add_recipe 'dotabay' 
    end 
end 
+0

爲什麼不只是'include_recipe'apt :: default''而不是手動更新東西? – sethvargo

+0

我在我的Vagrantfile中有'chef.add_recipe'apt'',這不是已經做到了嗎?無論如何,在將其添加到我的食譜後,它仍然給我同樣的錯誤。 – fivetwentysix

+0

發佈你的'Vagrantfile'。如果你有這個配方,你不需要執行apt-get update stuff – sethvargo

回答

相關問題