title: install rpm package using chef
body: <p>I am newbie to <code>Chef</code> and trying to install an <code>rpm package</code> in <code>CentOS vm</code>. I get this error when I run the <code>action: install command</code>. Looked at the <code>logs</code> and seems like an <code>access issue</code> though I am running  as <code>root user</code>. Log states <code>block in action-install</code> etc. Not sure what it means, <code>may be related to permission?</code></p>
  
  <p>I can run <code>rpm -ivh --nodeps package-name</code> and it works fine.</p>
  
  <p>If I run my <code>Chef recipe</code> it throw error. 
  This is recipe code:</p>
  
  <pre><code>package "package-name.rpm" do
  source "/package-name.rpm"
  action :install
  end
  </code></pre>
  
  <p>I run using <code>chef-client --local-mode --runlist package-name</code> so it runs against <code>local-repo</code> and not <code>yum</code>. </p>
  
  <p>This is my log:</p>
  
  <pre><code>Chef::Exceptions::Exec: package[package-name.rpm] (package-name::default line 15) had an error: Chef::Exceptions::Exec:  returned 1, expected 0
  /opt/chefdk/embedded/apps/chef/lib/chef/mixin/command.rb:158:in `handle_command_failures'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider/package/yum.rb:1021:in `yum_command'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider/package/yum.rb:1106:in `install_package'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider/package.rb:82:in `block in action_install'
  /opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `call'
  /opt/chefdk/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `add_action'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:156:in `converge_by'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider/package.rb:80:in `action_install'
  /opt/chefdk/embedded/apps/chef/lib/chef/provider.rb:121:in `run_action'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource.rb:648:in `run_action'
  /opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
  /opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
  /opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
  /opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:98:in `block in execute_each_resource'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
  /opt/chefdk/embedded/apps/chef/lib/chef/resource_collection.rb:96:in `execute_each_resource'
  /opt/chefdk/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
  /opt/chefdk/embedded/apps/chef/lib/chef/client.rb:345:in `converge'
  /opt/chefdk/embedded/apps/chef/lib/chef/client.rb:431:in `do_run'
  /opt/chefdk/embedded/apps/chef/lib/chef/client.rb:213:in `block in run'
  /opt/chefdk/embedded/apps/chef/lib/chef/client.rb:207:in `fork'
  /opt/chefdk/embedded/apps/chef/lib/chef/client.rb:207:in `run'
  /opt/chefdk/embedded/apps/chef/lib/chef/application.rb:237:in `run_chef_client'
  /opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:338:in `block in run_application'
  /opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:327:in `loop'
  /opt/chefdk/embedded/apps/chef/lib/chef/application/client.rb:327:in `run_application'
  /opt/chefdk/embedded/apps/chef/lib/chef/application.rb:55:in `run'
  /opt/chefdk/embedded/apps/chef/bin/chef-client:26:in `&lt;top (required)&gt;'
  /usr/bin/chef-client:34:in `load'
  /usr/bin/chef-client:34:in `&lt;main&gt;'
  </code></pre>
  
  <p>Any idea what I am doing wrong?</p>