From f7d3abc3079058e0e8ebeda34992eaa6eb99ac46 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 26 Jan 2021 11:48:41 +0100 Subject: [PATCH 1/2] Stop BTCPay server before compilation fixes #291 --- site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb b/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb index ac864dc..e6cba45 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb @@ -16,7 +16,10 @@ end bash 'build_btcpay' do cwd node['btcpay']['source_dir'] - code './build.sh' + code <<-EOH + systemctl stop btcpayserver.service + ./build.sh + EOH action :nothing notifies :restart, "systemd_unit[btcpayserver.service]", :delayed end From 5a5db43de393b596b069a1f53422b21985875f03 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Tue, 26 Jan 2021 11:49:20 +0100 Subject: [PATCH 2/2] Use new postgres client role and config Fixes btcpay having still used the old postgres master, and integrating it into the global client config setup from here on out. --- nodes/bitcoin-2.json | 4 +++- roles/btcpay.rb | 1 + site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes/bitcoin-2.json b/nodes/bitcoin-2.json index c99a571..01bd552 100644 --- a/nodes/bitcoin-2.json +++ b/nodes/bitcoin-2.json @@ -12,7 +12,8 @@ "hostname": "bitcoin-2", "ipaddress": "192.168.122.148", "roles": [ - "btcpay" + "btcpay", + "postgresql_client" ], "recipes": [ "kosmos-base", @@ -21,6 +22,7 @@ "kosmos-bitcoin::c-lightning", "kosmos-bitcoin::lnd", "kosmos-bitcoin::rtl", + "kosmos-postgresql::hostsfile", "kosmos-bitcoin::dotnet", "kosmos-bitcoin::nbxplorer", "kosmos-bitcoin::btcpay", diff --git a/roles/btcpay.rb b/roles/btcpay.rb index 05749c1..c3212d5 100644 --- a/roles/btcpay.rb +++ b/roles/btcpay.rb @@ -1,6 +1,7 @@ name "btcpay" run_list %w( + role[postgresql_client] kosmos-bitcoin::dotnet kosmos-bitcoin::nbxplorer kosmos-bitcoin::btcpay diff --git a/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb b/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb index e6cba45..562ef67 100644 --- a/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb +++ b/site-cookbooks/kosmos-bitcoin/recipes/btcpay.rb @@ -51,7 +51,7 @@ template node['btcpay']['config_path'] do nbxplorer_url: "http://127.0.0.1:#{node['nbxplorer']['port']}", btcpay_port: node['btcpay']['port'], btcpay_log_path: node['btcpay']['log_path'], - postgres_host: "192.168.122.1", + postgres_host: "pg.kosmos.local", postgres_port: node['btcpay']['postgres']['port'], postgres_database: node['btcpay']['postgres']['database'], postgres_user: node['btcpay']['postgres']['user'],