|
@@ -9,7 +9,6 @@ username = node['my_workstation']['default_user'].first[0]
|
|
|
user_repo_directory = ::File.join(node['my_workstation']['default_user'][username]['home'], 'repo')
|
|
|
ssh_ident_repo = ::File.join(user_repo_directory, 'ssh-ident')
|
|
|
ssh_ident_bin = ::File.join(ssh_ident_repo, 'ssh-ident')
|
|
|
-patch_file = '001-ssh_ident-fix-python.patch'
|
|
|
|
|
|
git ssh_ident_repo do
|
|
|
repository 'https://github.com/ccontavalli/ssh-ident'
|
|
@@ -17,20 +16,27 @@ git ssh_ident_repo do
|
|
|
action :checkout
|
|
|
end
|
|
|
|
|
|
-cookbook_file ::File.join(ssh_ident_repo, patch_file) do
|
|
|
- source patch_file
|
|
|
- owner username
|
|
|
- group username
|
|
|
- notifies :run, "execute[git am #{patch_file}]", :immediately
|
|
|
-end
|
|
|
|
|
|
# How to create a git patch:
|
|
|
# Ref: https://devconnected.com/how-to-create-and-apply-git-patch-files/
|
|
|
-execute "git am #{patch_file}" do
|
|
|
- cwd ssh_ident_repo
|
|
|
- action :nothing
|
|
|
-end
|
|
|
+patch_files = %w{
|
|
|
+ 001-ssh_ident-fix-python.patch
|
|
|
+ 0001-fix-timeout-Increase-the-ssh-key-in-memory-timeout-t.patch
|
|
|
+}
|
|
|
+
|
|
|
+patch_files.each do |patch_file|
|
|
|
+ cookbook_file ::File.join(ssh_ident_repo, patch_file) do
|
|
|
+ source patch_file
|
|
|
+ owner username
|
|
|
+ group username
|
|
|
+ end
|
|
|
+
|
|
|
+ execute "git am #{patch_file}" do
|
|
|
+ cwd ssh_ident_repo
|
|
|
+ only_if "/usr/bin/git apply #{patch_file} --check"
|
|
|
+ end
|
|
|
|
|
|
-execute "/usr/bin/install #{ssh_ident_bin} /usr/sbin/ssh-ident" do
|
|
|
- not_if { ::FileUtils.uptodate?('/usr/sbin/ssh-ident', [ssh_ident_bin]) }
|
|
|
+ execute "/usr/bin/install #{ssh_ident_bin} /usr/sbin/ssh-ident" do
|
|
|
+ not_if { ::FileUtils.uptodate?('/usr/sbin/ssh-ident', [ssh_ident_bin]) }
|
|
|
+ end
|
|
|
end
|