version "1.0.0"
supports "ubuntu"
depends "accounts"
-depends "munin"
depends "apache"
+depends "munin"
+depends "ruby"
depends "systemd"
#
include_recipe "accounts"
-include_recipe "munin"
include_recipe "apache"
+include_recipe "munin"
+include_recipe "ruby"
username = "overpass"
basedir = data_bag_item("accounts", username)["home"]
## Setup Apache
-gem_package "rotp"
+gem_package "rotp" do
+ gem_binary node[:ruby][:gem]
+end
directory "#{basedir}/apache" do
owner "root"
depends "git"
depends "incron"
depends "munin"
+depends "ruby"
depends "osmosis"
depends "systemd"
include_recipe "accounts"
include_recipe "apt"
include_recipe "osmosis"
+include_recipe "ruby"
+include_recipe "tools"
db_passwords = data_bag_item("db", "passwords")
package %w[
postgresql-client
- ruby
- ruby-dev
ruby-libxml
make
gcc
osmdbt
]
-gem_package "pg"
+gem_package "pg" do
+ gem_binary node[:ruby][:gem]
+end
## Build preload library to flush files
else
"3.0"
end
+default[:ruby][:gem] = "/usr/bin/gem#{node[:ruby][:version]}"
default[:ruby][:bundle] = "/usr/bin/bundle#{node[:ruby][:version]}"
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
depends "postgresql"
depends "prometheus"
depends "python"
+depends "ruby"
depends "systemd"
depends "tools"
include_recipe "postgresql"
include_recipe "prometheus"
include_recipe "python"
+include_recipe "ruby"
include_recipe "tools"
blocks = data_bag_item("tile", "blocks")
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"
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"
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"