From 046043ecc7f013b56f79ae0525095e85a92bbeb6 Mon Sep 17 00:00:00 2001 From: Stefan Galinski <stefan@sgalinski.de> Date: Mon, 14 Dec 2015 21:42:52 +0100 Subject: [PATCH] [FEATURE] Allow local file synchronisations --- recipes/default.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index 98857a2..09beeb5 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -230,8 +230,10 @@ end ######################### node['typo3_site']['sync_directories'].each do |sync_data| - ssh_known_hosts_entry sync_data['hostname'] do - port sync_data['port'] + if sync_data['hostname'] + ssh_known_hosts_entry sync_data['hostname'] do + port sync_data['port'] + end end bash 'Synchronize ' + sync_data['local'] do @@ -242,11 +244,18 @@ node['typo3_site']['sync_directories'].each do |sync_data| sync_data['sync'] or not ::File.exists?("#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}") } - code <<-EOF - rsync --delete -auvz --progress -e "ssh -p #{sync_data['port']} -o StrictHostKeyChecking=no" \ - --no-o --no-g #{sync_data['user']}@#{sync_data['hostname']}:#{sync_data['remote']} \ + if sync_data['hostname'] + code <<-EOF + rsync --delete -auvz --progress -e "ssh -p #{sync_data['port']} -o StrictHostKeyChecking=no" \ + --no-o --no-g #{sync_data['user']}@#{sync_data['hostname']}:#{sync_data['remote']} \ + "#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}"; + EOF + else + code <<-EOF + rsync --delete -auvz --progress --no-o --no-g #{sync_data['remote']} \ "#{node['typo3_site']['webroot']}/#{node['typo3_site']['hostname']}/#{sync_data['local']}"; - EOF + EOF + end action :run end end -- GitLab