From 7802ea25e6e6502b40197f45efbd2eabf4a9a5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Thu, 22 Dec 2022 19:45:45 +0700 Subject: [PATCH] Ignore chef environment when looking up primary We use mixed environments still, not everything is in "production" yet. --- site-cookbooks/kosmos_postgresql/libraries/helpers.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site-cookbooks/kosmos_postgresql/libraries/helpers.rb b/site-cookbooks/kosmos_postgresql/libraries/helpers.rb index 7d3c397..18e245d 100644 --- a/site-cookbooks/kosmos_postgresql/libraries/helpers.rb +++ b/site-cookbooks/kosmos_postgresql/libraries/helpers.rb @@ -1,7 +1,7 @@ class Chef class Recipe def postgresql_primary - postgresql_primary = search(:node, "role:postgresql_primary AND chef_environment:#{node.chef_environment}").first + postgresql_primary = search(:node, "role:postgresql_primary").first unless postgresql_primary.nil? primary_ip = ip_for(postgresql_primary)