From f34dfa1445a5dae4de955fb369814ec33cfe1d3f Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Thu, 18 Aug 2022 21:31:34 +0900 Subject: [PATCH] Do not install `rclone`. --- cookbooks/digdag/default.rb | 3 -- cookbooks/digdag/rclone_install.rb | 49 ------------------------------ cookbooks/digdag/rclone_setup.rb | 24 --------------- 3 files changed, 76 deletions(-) delete mode 100644 cookbooks/digdag/rclone_install.rb delete mode 100644 cookbooks/digdag/rclone_setup.rb diff --git a/cookbooks/digdag/default.rb b/cookbooks/digdag/default.rb index 1467544..f672485 100644 --- a/cookbooks/digdag/default.rb +++ b/cookbooks/digdag/default.rb @@ -5,9 +5,6 @@ include_recipe './install.rb' include_recipe './setup.rb' include_recipe './mc.rb' -include_recipe './rclone_install.rb' -include_recipe './rclone_setup.rb' - # AWS EC2 Swap Setting: if !node['is_ec2'] include_recipe './shared_dir.rb' diff --git a/cookbooks/digdag/rclone_install.rb b/cookbooks/digdag/rclone_install.rb deleted file mode 100644 index cd79298..0000000 --- a/cookbooks/digdag/rclone_install.rb +++ /dev/null @@ -1,49 +0,0 @@ -rclone_url = '' -rclone_dir = '' - -vtag = '' - -# Calculate the Download URL: -begin - require 'net/http' - - uri = URI.parse('https://github.com/rclone/rclone/releases/latest') - - Timeout.timeout(3) do - response = Net::HTTP.get_response(uri) - - vtag = $1 if response.body =~ %r{tag\/(v\d+\.\d+\.\d+)} - - rclone_dir = "#{node['rclone']['prefix']}#{vtag}#{node['rclone']['postfix']}" - rclone_url = "#{node['rclone']['url']}/#{vtag}/#{rclone_dir}.zip" - end -rescue - # Abort the chef client process: - raise 'Cannot connect to http://github.com.' -end - -# バージョン確認して、アップデート必要かどうか確認 -result = run_command("rclone --version 2>&1 | grep #{vtag}", error: false) -if result.exit_status != 0 - # Download: - TMP = "/tmp/#{rclone_dir}.zip" - - execute "wget #{rclone_url} -O #{TMP}" - - # Install: - execute "unzip -d /opt/ -o #{TMP}" - execute 'rm -rf /opt/rclone' - execute "mv /opt/#{rclone_dir} /opt/rclone" - - # Change Owner and Permissions: - file "#{node['rclone']['storage']}rclone" do - owner 'root' - group 'root' - mode '755' - end - - # Create Link - link "#{node['rclone']['location']}rclone" do - to "#{node['rclone']['storage']}rclone" - end -end diff --git a/cookbooks/digdag/rclone_setup.rb b/cookbooks/digdag/rclone_setup.rb deleted file mode 100644 index 662a5d0..0000000 --- a/cookbooks/digdag/rclone_setup.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Deploy the files: -directory '/home/kazu634/.config/rclone/' do - owner 'kazu634' - group 'kazu634' - mode '750' -end - -remote_file "/home/kazu634/.config/rclone/rclone.conf" do - owner 'kazu634' - group 'kazu634' - mode '600' -end - -directory '/root/.config/rclone/' do - owner 'root' - group 'root' - mode '750' -end - -remote_file "/root/.config/rclone/rclone.conf" do - owner 'kazu634' - group 'kazu634' - mode '600' -end