ark icon indicating copy to clipboard operation
ark copied to clipboard

Missing rsync package dependency

Open bitphage opened this issue 7 years ago • 5 comments

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

bitphage avatar May 04 '17 11:05 bitphage

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?

iennae avatar May 04 '17 15:05 iennae

OK I did not included ark recipe in my recipe like

include_recipe 'ark'

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

bitphage avatar May 05 '17 08:05 bitphage

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

tas50 avatar May 05 '17 16:05 tas50

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'

RulerOf avatar Oct 10 '18 11:10 RulerOf

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

PowerSchill avatar May 23 '19 00:05 PowerSchill