From project dir:
git clone https://github.com/causton81/net-ssh.git
cd net-ssh
git checkout causton81/channel_close_after_output
cd ..
git clone https://github.com/chef/chef.git
cd chef
git checkout 12.5.1
git patch <<END
diff --git a/chef.gemspec b/chef.gemspec
index b1abe76..828ee14 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
s.add_dependency "ohai", ">= 8.6.0.alpha.1", "< 9"
s.add_dependency "ffi-yajl", "~> 2.2"
- s.add_dependency "net-ssh", "~> 2.6"
+ s.add_dependency "net-ssh", "~> 3.0"
s.add_dependency "net-ssh-multi", "~> 1.1"
s.add_dependency "highline", "~> 1.6", ">= 1.6.9"
s.add_dependency "erubis", "~> 2.7"
END
cd ..
git clone https://github.com/chef/chef-provisioning.git
cd chef-provisioning
git checkout v1.5.0
# edit Gemfile
# -#gem 'net-ssh', :path => '../net-ssh'
# -#gem 'chef', :path => '../chef'
# +gem 'net-ssh', :path => '../net-ssh'
# +gem 'chef', :path => '../chef'
# edit chef-provisioning.gemspec
# Change to net-ssh ~> 3.0
Then build in chef-provisioning with bundle install --path vendor/bundle
Checkout a provisioning cookbook into chef-provisioning
cd <cookbook>
# add latency
sudo tc qdisc add dev eth0 root netem delay 120ms 20ms
Test the original
chef-client -z recipes/default.rb
# should fail
Test patch
bundle exec chef-client -z recipes/default.rb
# should work
Nice!