]> git.openstreetmap.org Git - chef.git/commitdiff
Make sure the correct gem is used to install ruby packages
authorTom Hughes <tom@compton.nu>
Sat, 2 Jul 2022 15:12:54 +0000 (16:12 +0100)
committerTom Hughes <tom@compton.nu>
Sat, 2 Jul 2022 16:07:19 +0000 (17:07 +0100)
cookbooks/overpass/metadata.rb
cookbooks/overpass/recipes/default.rb
cookbooks/planet/metadata.rb
cookbooks/planet/recipes/replication.rb
cookbooks/ruby/attributes/default.rb
cookbooks/ruby/recipes/default.rb
cookbooks/tile/metadata.rb
cookbooks/tile/recipes/default.rb
cookbooks/web/recipes/rails.rb

index e9755fe5df4d61d5d894d1682a7e5a3ea4e673de..cde954602abfbb2ece5c3471584c05dcddc3c4f8 100644 (file)
@@ -7,6 +7,7 @@ description       "Installs and configures an Overpass server"
 version           "1.0.0"
 supports          "ubuntu"
 depends           "accounts"
-depends           "munin"
 depends           "apache"
+depends           "munin"
+depends           "ruby"
 depends           "systemd"
index c53153339c47c0a1730dd6a0b3811380d765486e..690a28445102e3c32ababb5731658987ca18d07d 100644 (file)
@@ -18,8 +18,9 @@
 #
 
 include_recipe "accounts"
-include_recipe "munin"
 include_recipe "apache"
+include_recipe "munin"
+include_recipe "ruby"
 
 username = "overpass"
 basedir = data_bag_item("accounts", username)["home"]
@@ -72,7 +73,9 @@ end
 
 ## Setup Apache
 
-gem_package "rotp"
+gem_package "rotp" do
+  gem_binary node[:ruby][:gem]
+end
 
 directory "#{basedir}/apache" do
   owner "root"
index 6bc12d40fb8dccf0c44358d53bb1ecd6ea25725a..da36c06455a7e14415d60c827473563c700be853 100644 (file)
@@ -12,5 +12,6 @@ depends           "apt"
 depends           "git"
 depends           "incron"
 depends           "munin"
+depends           "ruby"
 depends           "osmosis"
 depends           "systemd"
index 629186fe2ee905eb634a19d6f97c684e4e4968a6..0a9387d19ca0237f544a44663ad1c06e052d9e8f 100644 (file)
@@ -22,6 +22,8 @@ require "yaml"
 include_recipe "accounts"
 include_recipe "apt"
 include_recipe "osmosis"
+include_recipe "ruby"
+include_recipe "tools"
 
 db_passwords = data_bag_item("db", "passwords")
 
@@ -29,8 +31,6 @@ db_passwords = data_bag_item("db", "passwords")
 
 package %w[
   postgresql-client
-  ruby
-  ruby-dev
   ruby-libxml
   make
   gcc
@@ -39,7 +39,9 @@ package %w[
   osmdbt
 ]
 
-gem_package "pg"
+gem_package "pg" do
+  gem_binary node[:ruby][:gem]
+end
 
 ## Build preload library to flush files
 
index 33ce58c0fe960adb02ed3a7ec2abd0e6ba0a6779..4ed2a3bb70d58b0f1e8c1b252b9d6597e1e822da 100644 (file)
@@ -3,4 +3,5 @@ default[:ruby][:version] = if node[:lsb][:release].to_f < 22.04
                            else
                              "3.0"
                            end
+default[:ruby][:gem] = "/usr/bin/gem#{node[:ruby][:version]}"
 default[:ruby][:bundle] = "/usr/bin/bundle#{node[:ruby][:version]}"
index 3ec7b03295596c1d54a4c9ce899c3ec399d4078b..a2833aefaf5e644d9be698acebc95f0f1cea0cdf 100644 (file)
@@ -29,13 +29,13 @@ package %W[
 gem_package "bundler#{ruby_version}-1" do
   package_name "bundler"
   version "~> 1.17.3"
-  gem_binary "gem#{ruby_version}"
+  gem_binary node[:ruby][:gem]
   options "--format-executable"
 end
 
 gem_package "bundler#{ruby_version}-2" do
   package_name "bundler"
   version "~> 2.3.16"
-  gem_binary "gem#{ruby_version}"
+  gem_binary node[:ruby][:gem]
   options "--format-executable"
 end
index bd84ccec03b2eec46ca135d89454c9b915497e6a..b07aad4f226f63abf842f02217e874e5e681a264 100644 (file)
@@ -14,5 +14,6 @@ depends           "nodejs"
 depends           "postgresql"
 depends           "prometheus"
 depends           "python"
+depends           "ruby"
 depends           "systemd"
 depends           "tools"
index 7f09a277704815e66dc1b5695ea05c2a31fe5844..40039b3148d7f351abad41a36fd4e73f575739b3 100644 (file)
@@ -25,6 +25,7 @@ include_recipe "nodejs"
 include_recipe "postgresql"
 include_recipe "prometheus"
 include_recipe "python"
+include_recipe "ruby"
 include_recipe "tools"
 
 blocks = data_bag_item("tile", "blocks")
@@ -508,15 +509,22 @@ end
 
 package %w[
   osm2pgsql
-  ruby
   osmium-tool
   pyosmium
   python3-pyproj
 ]
 
-gem_package "apachelogregex"
-gem_package "file-tail"
-gem_package "lru_redux"
+gem_package "apachelogregex" do
+  gem_binary node[:ruby][:gem]
+end
+
+gem_package "file-tail" do
+  gem_binary node[:ruby][:gem]
+end
+
+gem_package "lru_redux" do
+  gem_binary node[:ruby][:gem]
+end
 
 remote_directory "/usr/local/bin" do
   source "bin"
index 44ce2a4cdc12ed315be2d1ab80982cffc4ac860b..50758caeac2cff7ecb88bc720cbcab8d899a96dc 100644 (file)
@@ -173,8 +173,13 @@ template "/usr/local/bin/cleanup-rails-assets" do
   mode "755"
 end
 
-gem_package "apachelogregex"
-gem_package "file-tail"
+gem_package "apachelogregex" do
+  gem_binary node[:ruby][:gem]
+end
+
+gem_package "file-tail" do
+  gem_binary node[:ruby][:gem]
+end
 
 template "/usr/local/bin/api-statistics" do
   source "api-statistics.erb"
@@ -204,7 +209,9 @@ service "api-statistics" do
   subscribes :restart, "systemd_service[api-statistics]"
 end
 
-gem_package "hpricot"
+gem_package "hpricot" do
+  gem_binary node[:ruby][:gem]
+end
 
 munin_plugin "api_calls_status"
 munin_plugin "api_calls_num"