]> git.openstreetmap.org Git - chef.git/commitdiff
Use a precompiled promscale extension
authorTom Hughes <tom@compton.nu>
Sun, 10 Oct 2021 08:44:54 +0000 (09:44 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 10 Oct 2021 08:44:54 +0000 (09:44 +0100)
cookbooks/prometheus/files/default/postgresql-13-promscale.so [new file with mode: 0755]
cookbooks/prometheus/recipes/server.rb

diff --git a/cookbooks/prometheus/files/default/postgresql-13-promscale.so b/cookbooks/prometheus/files/default/postgresql-13-promscale.so
new file mode 100755 (executable)
index 0000000..1316df8
Binary files /dev/null and b/cookbooks/prometheus/files/default/postgresql-13-promscale.so differ
index 11ff21dab8f941e20e43ebe396f3804f902cb371..12ad43f4370085d4e68320ff51e848dd9619296c 100644 (file)
@@ -39,7 +39,8 @@ package %w[
 
 promscale_version = "0.6.1"
 
-database_cluster = "#{node[:timescaledb][:database_version]}/main"
+database_version = node[:timescaledb][:database_version]
+database_cluster = "#{database_version}/main"
 
 postgresql_user "prometheus" do
   cluster database_cluster
@@ -57,30 +58,11 @@ directory "/opt/promscale" do
   mode "755"
 end
 
-package %w[
-  make
-  gcc
-  clang-9
-  llvm-9
-  cargo
-]
-
-git "/opt/promscale/extension" do
-  action :sync
-  repository "https://github.com/timescale/promscale_extension.git"
-  revision "0.2.0"
-  user "root"
-  group "root"
-end
-
-execute "/opt/promscale/extension/Makefile" do
-  action :nothing
-  command "make install"
-  cwd "/opt/promscale/extension"
-  user "root"
+cookbook_file "/usr/lib/postgresql/#{database_version}/lib/promscale.so" do
+  source "postgresql-#{database_version}-promscale.so"
+  owner "root"
   group "root"
-  subscribes :run, "git[/opt/promscale/extension]", :immediately
-  notifies :restart, "service[postgresql]", :immediately
+  mode "644"
 end
 
 directory "/opt/promscale/bin" do