我正在使用厨师在我的基础设施中configurationVPN服务器。 下面是用于安装libreswan-ipsec vpn的几个组件的libreswan-ipsec 。
%w( libnss3-dev libnspr4-dev pkg-config libpam0g-dev libcap-ng-dev libcap-ng-utils libselinux1-dev libcurl4-nss-dev libgmp3-dev flex bison gcc make libunbound-dev libnss3-tools wget vim traceroute ).each do |pkg| package pkg do action :install end end
现在我需要添加更多的组件到这个列表中进行安装,但是我需要在安装完所有上面的组件后安装它们。 以下是这两个安装包的代码。
%w( libevent-dev xmlto ).each do |pkg| package pkg do action :install end end
但是,当我运行食谱时,它们将所有这些东西放在一起,并在Debian软件包pipe理器上安装和拆分服务器上的东西。 基本上我想要的是修复安装stream程的原因,当我手动安装这些包,它的工作原理。 我怎么能做到这一点? 以下是现在破坏了的包pipe理器的日志。
[2016-12-26T15:59:11+00:00] INFO: Starting Chef Run for ip-10-0-10-19 [2016-12-26T15:59:11+00:00] INFO: Running start handlers [2016-12-26T15:59:11+00:00] INFO: Start handlers complete. [2016-12-26T15:59:11+00:00] INFO: Application light-weight resource already initialized -- overriding! [2016-12-26T15:59:11+00:00] INFO: Preparing removal of dependency: dpkg landscape-common [2016-12-26T15:59:11+00:00] INFO: Preparing removal of dependency: dpkg landscape-client [2016-12-26T15:59:11+00:00] INFO: Preparing removal of dependency: dpkg popularity-contest [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg htop [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg lynx [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg vim-nox [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg git [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg curl [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg libcurl3-dev [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg tree [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg screen [2016-12-26T15:59:11+00:00] INFO: Preparing installation of dependency: dpkg traceroute [2016-12-26T15:59:12+00:00] INFO: Preparing installation of dependency: dpkg libpq-dev [2016-12-26T15:59:12+00:00] INFO: Preparing installation of dependency: gem bundler [2016-12-26T15:59:12+00:00] INFO: Preparing installation of dependency: gem ruby-shadow [2016-12-26T15:59:12+00:00] INFO: Preparing installation of dependency: gem pg [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for service[postfix] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous service[postfix]: /var/chef/vendor/cookbooks/postfix/recipes/default.rb:30:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current service[postfix]: /var/chef/vendor/cookbooks/postfix/recipes/default.rb:63:in `from_file' [2016-12-26T15:59:12+00:00] WARN: require_recipe is deprecated and will be removed in a future release, please use include_recipe [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for group[sudo] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Current group[sudo]: /var/chef/vendor/cookbooks/user/recipes/data_bag.rb:46:in `block (2 levels) in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for package[vim-nox] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous package[vim-nox]: /var/chef/cookbooks/initial_setup/recipes/install_packages.rb:3:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Current package[vim-nox]: /var/chef/cookbooks/vim/recipes/default.rb:29:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for directory[/etc/logstash] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous directory[/etc/logstash]: /var/chef/cookbooks/logstash/recipes/default.rb:24:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current directory[/etc/logstash]: /var/chef/cookbooks/logstash/definitions/logstash_file.rb:8:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for service[logstash] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous service[logstash]: /var/chef/cookbooks/logstash/definitions/logstash_file.rb:3:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Current service[logstash]: /var/chef/cookbooks/logstash/recipes/shipper.rb:18:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for package[wget] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous package[wget]: /var/chef/cookbooks/newrelic/recipes/default.rb:1:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current package[wget]: /var/chef/cookbooks/ipsec/recipes/default.rb:18:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for package[traceroute] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous package[traceroute]: /var/chef/cookbooks/initial_setup/recipes/install_packages.rb:3:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Current package[traceroute]: /var/chef/cookbooks/ipsec/recipes/default.rb:18:in `block in from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for service[ipsec] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous service[ipsec]: /var/chef/cookbooks/ipsec/recipes/default.rb:9:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current service[ipsec]: /var/chef/cookbooks/karma_ipsec/recipes/default.rb:4:in `from_file' [2016-12-26T15:59:12+00:00] INFO: ohai plugins will be at: /etc/chef/ohai_plugins [2016-12-26T15:59:12+00:00] INFO: Processing remote_directory[/etc/chef/ohai_plugins] action create (ohai::default line 30) [2016-12-26T15:59:12+00:00] INFO: Processing cookbook_file[/etc/chef/ohai_plugins/README] action create (dynamically defined) [2016-12-26T15:59:12+00:00] INFO: Processing ohai[custom_plugins] action reload (ohai::default line 44) [2016-12-26T15:59:12+00:00] INFO: ohai[custom_plugins] reloaded [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for service[nginx] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous service[nginx]: /var/chef/vendor/cookbooks/nginx/recipes/default.rb:42:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current service[nginx]: /var/chef/vendor/cookbooks/nginx/recipes/default.rb:54:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Cloning resource attributes for service[nginx] from prior resource (CHEF-3694) [2016-12-26T15:59:12+00:00] WARN: Previous service[nginx]: /var/chef/vendor/cookbooks/nginx/recipes/default.rb:54:in `from_file' [2016-12-26T15:59:12+00:00] WARN: Current service[nginx]: /var/chef/cookbooks/karma_dante/recipes/default.rb:17:in `from_file' [2016-12-26T15:59:12+00:00] INFO: Processing execute[apt-get-update] action run (apt::default line 22) [2016-12-26T15:59:12+00:00] INFO: Processing execute[apt-get update] action nothing (apt::default line 29) [2016-12-26T15:59:12+00:00] INFO: Processing execute[apt-get autoremove] action nothing (apt::default line 36) [2016-12-26T15:59:12+00:00] INFO: Processing execute[apt-get autoclean] action nothing (apt::default line 42) [2016-12-26T15:59:12+00:00] INFO: Processing package[update-notifier-common] action install (apt::default line 48) [2016-12-26T15:59:12+00:00] INFO: Processing execute[apt-get-update-periodic] action run (apt::default line 52) [2016-12-26T15:59:12+00:00] INFO: Processing directory[/var/cache/local] action create (apt::default line 62) [2016-12-26T15:59:12+00:00] INFO: Processing directory[/var/cache/local/preseeding] action create (apt::default line 62) [2016-12-26T15:59:12+00:00] INFO: Processing package[landscape-common] action purge (initial_setup::remove_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[landscape-client] action purge (initial_setup::remove_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[popularity-contest] action purge (initial_setup::remove_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[htop] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[lynx] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[vim-nox] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[git] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[curl] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:12+00:00] INFO: Processing package[libcurl3-dev] action install (initial_setup::install_packages line 3) [2016-12-26T15:59:13+00:00] INFO: package[libcurl3-dev] is a virtual package, actually acting on package[libcurl4-openssl-dev] ================================================================================ Error executing action `install` on resource 'package[libcurl3-dev]' ================================================================================ Chef::Exceptions::Exec ---------------------- apt-get -q -y install libcurl3-dev returned 100, expected 0 Resource Declaration: --------------------- # In /var/chef/cookbooks/initial_setup/recipes/install_packages.rb 3: package pkg do 4: action :install 5: end 6: end Compiled Resource: ------------------ # Declared in /var/chef/cookbooks/initial_setup/recipes/install_packages.rb:3:in `block in from_file' package("libcurl3-dev") do action [:install] retries 0 retry_delay 2 package_name "libcurl3-dev" version "7.35.0-1ubuntu2.10" cookbook_name :initial_setup recipe_name "install_packages" end [2016-12-26T15:59:15+00:00] ERROR: Running exception handlers [2016-12-26T15:59:15+00:00] ERROR: Exception handlers complete [2016-12-26T15:59:15+00:00] FATAL: Stacktrace dumped to /var/cache/chef-solo/chef-stacktrace.out [2016-12-26T15:59:15+00:00] FATAL: Chef::Exceptions::Exec: package[libcurl3-dev] (initial_setup::install_packages line 3) had an error: Chef::Exceptions::Exec: apt-get -q -y install libcurl3-dev returned 100, expected 0 ssutar@i-production-base:~$ sudo apt-get -q -y install libcurl3-dev Reading package lists... Building dependency tree... Reading state information... libcurl4-openssl-dev is already the newest version. The following package was automatically installed and is no longer required: libcurl3-nss Use 'apt-get autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 96 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up dante-server (1.4.1-1) ... Starting Dante SOCKS daemon: invoke-rc.d: initscript danted, action "start" failed. dpkg: error processing package dante-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: dante-server E: Sub-process /usr/bin/dpkg returned an error code (1) ssutar@i-production-base:~$ sudo apt-get autoremove Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: libcurl3-nss 0 upgraded, 0 newly installed, 1 to remove and 96 not upgraded. 1 not fully installed or removed. After this operation, 563 kB disk space will be freed. Do you want to continue? [Y/n] (Reading database ... 97703 files and directories currently installed.) Removing libcurl3-nss:amd64 (7.35.0-1ubuntu2.10) ... Processing triggers for libc-bin (2.19-0ubuntu6.9) ... Setting up dante-server (1.4.1-1) ... Starting Dante SOCKS daemon: invoke-rc.d: initscript danted, action "start" failed. dpkg: error processing package dante-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: dante-server E: Sub-process /usr/bin/dpkg returned an error code (1) ssutar@i-production-base:~$ sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 96 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up dante-server (1.4.1-1) ... Starting Dante SOCKS daemon: invoke-rc.d: initscript danted, action "start" failed. dpkg: error processing package dante-server (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: dante-server E: Sub-process /usr/bin/dpkg returned an error code (1)
如果apt不处理sorting,则可以使用单个包创build单独的安assembly方/文件,然后使用include_recipe和适当的depends语句(如本答案中所述)