sous-chefs / ark

Development repository for the ark cookbook
https://supermarket.chef.io/cookbooks/ark
Apache License 2.0
99 stars 181 forks source link

Missing rsync package dependency #192

Open bitphage opened 7 years ago

bitphage commented 7 years ago

Cookbook version

3.0.0

Chef-client version

13.0.118

Platform Details

ubuntu 16.04

Scenario:

Just testing my cookbook which uses ark resource in kitchen environment.

Steps to Reproduce:

Remove rsync package from the target system, then try to run chef-client.

Expected Result:

Ark resource successful run

Actual Result:

           * execute[unpack /tmp/kitchen/cache/osm-import-scripts-1.zip] action run

             ================================================================================
             Error executing action `run` on resource 'execute[unpack /tmp/kitchen/cache/osm-import-scripts-1.zip]'
             ================================================================================

             Mixlib::ShellOut::ShellCommandFailed
             ------------------------------------
             Expected process to exit with [0], but received '127'
             ---- Begin output of unzip -q -o /tmp/kitchen/cache/osm-import-scripts-1.zip -d /tmp/d20170504-1638-1wmicpk && rsync -a /tmp/d20170504-1638-1wmicpk/*/ /usr/local/osm-import-scripts-1 && rm -rf /tmp/d20170504-1638-1wmicpk ----
             STDOUT: 
             STDERR: sh: 1: rsync: not found
             ---- End output of unzip -q -o /tmp/kitchen/cache/osm-import-scripts-1.zip -d /tmp/d20170504-1638-1wmicpk && rsync -a /tmp/d20170504-1638-1wmicpk/*/ /usr/local/osm-import-scripts-1 && rm -rf /tmp/d20170504-1638-1wmicpk ----
             Ran unzip -q -o /tmp/kitchen/cache/osm-import-scripts-1.zip -d /tmp/d20170504-1638-1wmicpk && rsync -a /tmp/d20170504-1638-1wmicpk/*/ /usr/local/osm-import-scripts-1 && rm -rf /tmp/d20170504-1638-1wmicpk returned 127
iennae commented 7 years ago

According to https://github.com/chef-cookbooks/ark/blob/871c417d6bcc764fca8ca62e19cef4e0d49e1dbd/attributes/default.rb#L32 rsync is already listed as a dependency package except for mac os x platform systems. In the recipe https://github.com/chef-cookbooks/ark/blob/master/recipes/default.rb, the package dependencies are installed. Can you provide more information about how you are using this?

bitphage commented 7 years ago

OK I did not included ark recipe in my recipe like

include_recipe 'ark'

Probably README should mention this? Now it's not.

tas50 commented 7 years ago

Yep there's a definite flaw here and I think the solution is to make sure we add it dynamically via the resource. I just ran into this the other day and it was a bit of a head scratcher since I thought it all worked automatically

RulerOf commented 6 years ago

I ran into this today trying to use ark to unzip a local file like

# Extract the war file
ark "clover" do
  action :put
  url "file://path/to/application.war"
  path "/opt/application"
end

Worked around it by just putting this before my ark resource:

package 'rsync'
PowerSchill commented 5 years ago

Might be a stupid question but wouldn't a simple fix be to move the lines from the recipe to the resource?