如何获得使用Chef's apt cookbook的密钥

时间:2014-07-02 16:59:37

标签: postgresql ubuntu chef apt

我使用Chef Solo在12.04 Ubuntu和Vagrant上运行。

PPA回购:https://launchpad.net/~chris-lea/+archive/postgresql-9.3 apt 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

1 个答案:

答案 0 :(得分:0)

查看https://launchpad.net/~chris-lea/+archive/postgresql-9.3您的签名密钥错误。它应该是C7917B12