]> git.openstreetmap.org Git - chef.git/commitdiff
Convert some normal attributes to default or override
authorTom Hughes <tom@compton.nu>
Tue, 21 Jul 2020 21:59:43 +0000 (21:59 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 21 Jul 2020 21:59:43 +0000 (21:59 +0000)
cookbooks/networking/recipes/default.rb
cookbooks/openvpn/recipes/default.rb
cookbooks/web/attributes/default.rb
cookbooks/web/recipes/backend.rb

index 4c0e047465fe81949bcd1d5070a8af2541282658..b643296f4883e1f36b6a1cd26f6e655d51804187 100644 (file)
@@ -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]
index 9cae35c67eb5ffcdcb5c48b29c35abe1c18a0958..c027466f1eef1edb9745785b0fdf51817040e056 100644 (file)
@@ -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
index 7c995d9d818b65c54deb345986ce2a46cc8742a7..d842b2d00d342eaa33e751211a41bc0f455f7fb9 100644 (file)
@@ -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
index 97bab57c70ff57b294a305d1b2495ce5434a57f6..4c7bb9c1c74c8aea399b48021dae1c4254c8ab40 100644 (file)
@@ -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