我有一个非常简单的厨师食谱,它尝试在 EC2 和 Vagrant VM(都运行 Ubuntu 12.04)上安装 RabbitMQ 和几个 RabbitMQ 插件。
我正在使用 OpsCode RabbitMQ 食谱(https://github.com/opscode-cookbooks/rabbitmq),当我配置机器时,我得到以下堆栈跟踪:
INFO: Processing apt_repository[rabbitmq] action add (rabbitmq::default line 43)
INFO: Processing remote_file[/srv/chef/file_store/rabbitmq-signing-key-public.asc] action create (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 36)
INFO: remote_file[/srv/chef/file_store/rabbitmq-signing-key-public.asc] updated
INFO: remote_file[/srv/chef/file_store/rabbitmq-signing-key-public.asc] mode changed to 644
INFO: Processing execute[install-key rabbitmq-signing-key-public.asc] action run (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 52)
INFO: execute[install-key rabbitmq-signing-key-public.asc] ran successfully
INFO: apt_repository[rabbitmq] sending run action to execute[apt-get update] (immediate)
INFO: Processing execute[apt-get update] action run (apt::default line 29)
INFO: execute[apt-get update] ran successfully
INFO: Processing remote_file[/srv/chef/file_store/rabbitmq-signing-key-public.asc] action nothing (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 36)
INFO: Processing execute[install-key rabbitmq-signing-key-public.asc] action nothing (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 52)
INFO: Processing execute[apt-get update] action nothing (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 78)
INFO: Processing file[/etc/apt/sources.list.d/rabbitmq-source.list] action create (/srv/chef/file_store/cookbooks/apt/providers/repository.rb line 89)
INFO: file[/etc/apt/sources.list.d/rabbitmq-source.list] created file /etc/apt/sources.list.d/rabbitmq-source.list
INFO: Processing package[util-linux] action install (rabbitmq::default line 53)
INFO: Processing package[rabbitmq-server] action install (rabbitmq::default line 54)
ERROR: package[rabbitmq-server] (rabbitmq::default line 54) has had an error
...
FATAL: Chef::Exceptions::Exec: package[rabbitmq-server] (rabbitmq::default line 54) had an error: Chef::Exceptions::Exec: apt-get -q -y install rabbitmq-server=2.7.1-0ubuntu4 returned 100, expected 0
正如您从日志中看到的那样,在apt-get update
添加新的 rabbitmq 源之前正在发生这种情况(这意味着它尝试安装 rabbitmq-server 版本 2.7.1 与 RabbitMQ 存储库中的 2.8.x 版本。
这是食谱代码:https ://github.com/opscode-cookbooks/rabbitmq/blob/master/recipes/default.rb#L43-54
任何想法如何解决这个问题?