如何在Chef-solo中排除某个包更新

时间:2015-08-07 05:33:46

标签: chef yum chef-solo

我有一个简单的厨师脚本来安装httpd

package "httpd"

当我执行此操作时,它还会尝试更新其他软件包(在该节点上手动设置的软件包)

有没有办法在运行Chef时排除所有/某些包的更新?

这是chef.log中的错误:

INFO: *** Chef 10.32.2 ***  
WARN: Run List override has been provided.  
WARN: Original Run List: []  
WARN: Overridden Run List: [role[web]]  
INFO: Run List is [role[web]]  
INFO: Run List expands to [apache2]  
INFO: Starting Chef Run for testserver.domain.net    
INFO: Running start handlers  
INFO: Start handlers complete.  
INFO: Processing package[httpd] action install (apache2::default line 12)  
ERROR: Running exception handlers  
ERROR: Exception handlers complete
FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
FATAL: Mixlib::ShellOut::ShellCommandFailed: package[httpd] (apache2::default line 12) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
STDOUT: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-PAE kernel-PAE-debug
STDERR: yum-dump Repository Error: Cannot retrieve repository metadata (repomd.xml) for repository: newrelic. Please verify its path and try again
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides ----
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1  

来自chef-stacktrace.out

Mixlib::ShellOut::ShellCommandFailed: package[httpd] (apache2::default line 12) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides ----  
STDOUT: [option installonlypkgs] kernel kernel-bigmem installonlypkg(kernel-module) installonlypkg(vm) kernel-enterprise kernel-smp kernel-debug kernel-unsupported kernel-source kernel-devel kernel-PAE kernel-PAE-debug  
STDERR: yum-dump Repository Error: Cannot retrieve repository metadata (repomd.xml) for repository: newrelic. Please verify its path and try again  
---- End output of /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides ----  
Ran /usr/bin/python /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum-dump.py --options --installed-provides returned 1  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.4.0/lib/mixlib/shellout.rb:257:in `invalid!'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/mixlib-shellout-1.4.0/lib/mixlib/shellout.rb:244:in `error!'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/mixin/shell_out.rb:36:in `shell_out!'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum.rb:714:in `refresh'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum.rb:806:in `package_available?'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider/package/yum.rb:1055:in `load_current_resource'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/provider.rb:98:in `run_action'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource.rb:627:in `run_action'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/runner.rb:49:in `run_action'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/runner.rb:81:in `block (2 levels) in converge'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/runner.rb:81:in `each'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/runner.rb:81:in `block in converge'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection.rb:94:in `block in execute_each_resource'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/resource_collection.rb:92:in `execute_each_resource'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/runner.rb:80:in `converge'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/client.rb:385:in `converge'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/client.rb:427:in `do_run'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/client.rb:183:in `run'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application.rb:133:in `run_chef_client'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application/solo.rb:224:in `block in run_application'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application/solo.rb:216:in `loop'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application/solo.rb:216:in `run_application'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/lib/chef/application.rb:65:in `run'  
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-10.32.2/bin/chef-solo:25:in `<top (required)>'  
/usr/bin/chef-solo:23:in `load'  
/usr/bin/chef-solo:23:in `<main>'  

0 个答案:

没有答案