From: Tom Hughes Date: Tue, 21 Jul 2020 21:59:43 +0000 (+0000) Subject: Convert some normal attributes to default or override X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/f5005ec395d870ace9cc54243dcf79f49150c6ce Convert some normal attributes to default or override --- diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 4c0e04746..b643296f4 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -39,20 +39,20 @@ node[:networking][:interfaces].each do |name, interface| if interface[:interface] if interface[:role] && (role = node[:networking][:roles][interface[:role]]) if role[interface[:family]] - node.normal[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] - node.normal[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway] - node.normal[:networking][:interfaces][name][:routes] = role[interface[:family]][:routes] + node.default[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] + node.default[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway] + node.default[:networking][:interfaces][name][:routes] = role[interface[:family]][:routes] end - node.normal[:networking][:interfaces][name][:metric] = role[:metric] - node.normal[:networking][:interfaces][name][:zone] = role[:zone] + node.default[:networking][:interfaces][name][:metric] = role[:metric] + node.default[:networking][:interfaces][name][:zone] = role[:zone] end if interface[:address] prefix = node[:networking][:interfaces][name][:prefix] - node.normal[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix) - node.normal[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) + node.default[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix) + node.default[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) end interface = node[:networking][:interfaces][name] diff --git a/cookbooks/openvpn/recipes/default.rb b/cookbooks/openvpn/recipes/default.rb index 9cae35c67..c027466f1 100644 --- a/cookbooks/openvpn/recipes/default.rb +++ b/cookbooks/openvpn/recipes/default.rb @@ -49,7 +49,7 @@ node[:openvpn][:tunnels].each do |name, details| end if File.exist?("/etc/openvpn/#{name}.key") - node.normal[:openvpn][:keys][name] = IO.read("/etc/openvpn/#{name}.key") + node.default[:openvpn][:keys][name] = IO.read("/etc/openvpn/#{name}.key") end elsif peer && peer[:openvpn] file "/etc/openvpn/#{name}.key" do diff --git a/cookbooks/web/attributes/default.rb b/cookbooks/web/attributes/default.rb index 7c995d9d8..d842b2d00 100644 --- a/cookbooks/web/attributes/default.rb +++ b/cookbooks/web/attributes/default.rb @@ -4,3 +4,5 @@ default[:web][:log_directory] = "/var/log/web" default[:web][:primary_cluster] = false default[:accounts][:users][:rails][:status] = :role + +override[:memcached][:ip_address] = node.internal_ipaddress diff --git a/cookbooks/web/recipes/backend.rb b/cookbooks/web/recipes/backend.rb index 97bab57c7..4c7bb9c1c 100644 --- a/cookbooks/web/recipes/backend.rb +++ b/cookbooks/web/recipes/backend.rb @@ -40,8 +40,6 @@ apache_site "www.openstreetmap.org" do :secret_key_base => web_passwords["secret_key_base"] end -node.normal[:memcached][:ip_address] = node.internal_ipaddress - service "rails-jobs@storage" do action [:enable, :start] supports :restart => true