Ignore chef environment when looking up primary

We use mixed environments still, not everything is in "production" yet.
This commit is contained in:
Râu Cao 2022-12-22 19:45:45 +07:00
parent fb1206d03f
commit 7802ea25e6
Signed by: raucao
GPG Key ID: 15E65F399D084BA9

View File

@ -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)