From ff044920428608b2c04507ad52d6ab52c9d6555f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 2 Feb 2015 22:41:04 +0000 Subject: [PATCH 1/1] Remove trailing whitespace in ruby code --- cookbooks/chef/libraries/remote_directory.rb | 2 +- cookbooks/dns/recipes/default.rb | 2 +- cookbooks/exim/recipes/default.rb | 2 +- cookbooks/mediawiki/attributes/default.rb | 1 - .../definitions/mediawiki_extension.rb | 2 +- .../mediawiki/definitions/mediawiki_site.rb | 4 +- .../munin/files/default/plugins/api_calls_ | 16 +++---- .../munin/files/default/plugins/api_calls_num | 14 +++---- .../munin/files/default/plugins/api_waits_ | 16 +++---- .../files/default/plugins/passenger_memory | 11 +++-- cookbooks/munin/libraries/expand.rb | 4 +- cookbooks/networking/metadata.rb | 1 - cookbooks/nginx/attributes/default.rb | 1 - cookbooks/nginx/recipes/default.rb | 1 - cookbooks/nominatim/recipes/default.rb | 1 - cookbooks/ntp/attributes/default.rb | 2 +- cookbooks/ntp/metadata.rb | 1 - cookbooks/piwik/recipes/default.rb | 2 +- .../replication-bin/replicate-changesets | 7 ++-- cookbooks/postgresql/providers/table.rb | 2 +- cookbooks/roundup/recipes/default.rb | 1 - cookbooks/squid/attributes/default.rb | 1 - cookbooks/tile/files/default/ruby/expire.rb | 42 +++++++++---------- cookbooks/tile/recipes/default.rb | 14 +++---- cookbooks/tilecache/attributes/default.rb | 1 - cookbooks/tools/recipes/default.rb | 1 - cookbooks/wiki/recipes/default.rb | 5 +-- cookbooks/yournavigation/recipes/default.rb | 1 - roles/base.rb | 4 +- roles/chef-repository.rb | 2 +- roles/db.rb | 6 +-- roles/dev.rb | 26 ++++++------ roles/draco.rb | 2 +- roles/forum.rb | 2 +- roles/ironbelly.rb | 2 +- roles/jakelong.rb | 2 +- roles/mail.rb | 2 +- roles/nadder-01.rb | 2 +- roles/nadder-02.rb | 2 +- roles/nepomuk.rb | 2 +- roles/nominatim.rb | 4 +- roles/orm.rb | 2 +- roles/owl.rb | 2 +- roles/ramoth.rb | 2 +- roles/smaug.rb | 4 +- roles/stats.rb | 4 +- roles/tilecache.rb | 4 +- roles/tyan-s7010.rb | 2 +- roles/ucl-wates.rb | 2 +- roles/yevaud.rb | 6 +-- 50 files changed, 115 insertions(+), 129 deletions(-) diff --git a/cookbooks/chef/libraries/remote_directory.rb b/cookbooks/chef/libraries/remote_directory.rb index 97adee117..32dacc500 100644 --- a/cookbooks/chef/libraries/remote_directory.rb +++ b/cookbooks/chef/libraries/remote_directory.rb @@ -4,7 +4,7 @@ class Chef def action_create super Chef::Log.debug("Doing a remote recursive directory transfer for #{@new_resource}") - + files_transferred = Set.new files_to_transfer.each do |cookbook_file_relative_path| create_cookbook_file(cookbook_file_relative_path) diff --git a/cookbooks/dns/recipes/default.rb b/cookbooks/dns/recipes/default.rb index 768ad711b..95e3957fa 100644 --- a/cookbooks/dns/recipes/default.rb +++ b/cookbooks/dns/recipes/default.rb @@ -71,7 +71,7 @@ template "/srv/dns.openstreetmap.org/html/index.html" do variables :zones => zones end -apache_site "dns.openstreetmap.org" do +apache_site "dns.openstreetmap.org" do template "apache.erb" directory "/srv/dns.openstreetmap.org" end diff --git a/cookbooks/exim/recipes/default.rb b/cookbooks/exim/recipes/default.rb index b53da4e03..abf404303 100644 --- a/cookbooks/exim/recipes/default.rb +++ b/cookbooks/exim/recipes/default.rb @@ -40,7 +40,7 @@ template "/tmp/exim.ssl.cnf" do mode 0644 not_if do File.exist?("/etc/ssl/certs/exim.pem") and File.exist?("/etc/ssl/private/exim.key") - end + end end execute "/etc/ssl/certs/exim.pem" do diff --git a/cookbooks/mediawiki/attributes/default.rb b/cookbooks/mediawiki/attributes/default.rb index 59f020120..7fce6d785 100644 --- a/cookbooks/mediawiki/attributes/default.rb +++ b/cookbooks/mediawiki/attributes/default.rb @@ -8,4 +8,3 @@ default[:apache][:mpm] = "prefork" default[:mediawiki][:user] = "wiki" default[:mediawiki][:group] = "wiki" default[:mediawiki][:sites] = {} - diff --git a/cookbooks/mediawiki/definitions/mediawiki_extension.rb b/cookbooks/mediawiki/definitions/mediawiki_extension.rb index 134bc4497..f3622dc37 100644 --- a/cookbooks/mediawiki/definitions/mediawiki_extension.rb +++ b/cookbooks/mediawiki/definitions/mediawiki_extension.rb @@ -79,6 +79,6 @@ define :mediawiki_extension, :action => [ :enable ], :variables => {} do mode 0664 content " "#{mediawiki_directory}/LocalSettings.php") + notifies :create, resources(:template => "#{mediawiki_directory}/LocalSettings.php") end end diff --git a/cookbooks/mediawiki/definitions/mediawiki_site.rb b/cookbooks/mediawiki/definitions/mediawiki_site.rb index 8b7467010..5ceccf69c 100644 --- a/cookbooks/mediawiki/definitions/mediawiki_site.rb +++ b/cookbooks/mediawiki/definitions/mediawiki_site.rb @@ -46,7 +46,7 @@ define :mediawiki_site, :action => [ :create, :enable ] do :logo => params[:logo] || "$wgStylePath/common/images/wiki.png", :email_contact => params[:email_contact] || "", :email_sender => params[:email_sender] || "", - :email_sender_name => params[:email_sender_name] || "MediaWiki Mail", + :email_sender_name => params[:email_sender_name] || "MediaWiki Mail", :commons => params[:commons] || TRUE, :skin => params[:skin] || "vector", :site_notice => params[:site_notice] || "", @@ -203,7 +203,7 @@ define :mediawiki_site, :action => [ :create, :enable ] do mediawiki_extension "Cite" do site name - template "mw-ext-Cite.inc.php.erb" + template "mw-ext-Cite.inc.php.erb" end mediawiki_extension "ConfirmEdit" do diff --git a/cookbooks/munin/files/default/plugins/api_calls_ b/cookbooks/munin/files/default/plugins/api_calls_ index 179c07fb5..8cf836d79 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_ +++ b/cookbooks/munin/files/default/plugins/api_calls_ @@ -5,7 +5,7 @@ require 'date' require 'hpricot' require 'open-uri' -def uris_from_status(server) +def uris_from_status(server) file = open("http://#{server}/server-status").read doc = Hpricot.parse(file) tables = doc / 'table' @@ -18,19 +18,19 @@ def uris_from_status(server) end CALL_TYPES = { - :map => "Map API calls", - :upload => "Changeset diff uploads", - :amf => "AMF API calls", - :history => "Element history fetches", + :map => "Map API calls", + :upload => "Changeset diff uploads", + :amf => "AMF API calls", + :history => "Element history fetches", :full => "Full element fetches", :trkpts => "GPX trackpoints calls", - :web => "Web site traffic", + :web => "Web site traffic", :other => "Other API calls" } def categorise_uri(line) uri = line.split(" ")[1] - + case uri when /api\/0\.6\/map/ then :map when /api\/0\.6\/changeset\/[0-9]*\/upload/ then :upload @@ -62,7 +62,7 @@ else end h end - + CALL_TYPES.keys.each do |type| count = counts[type] || 0 puts "#{type}.value #{count}" diff --git a/cookbooks/munin/files/default/plugins/api_calls_num b/cookbooks/munin/files/default/plugins/api_calls_num index b0c23664b..d2f7ea372 100755 --- a/cookbooks/munin/files/default/plugins/api_calls_num +++ b/cookbooks/munin/files/default/plugins/api_calls_num @@ -28,19 +28,19 @@ def uris_from_logs end CALL_TYPES = { - :map => "Map API calls", - :upload => "Changeset diff uploads", - :amf => "AMF API calls", - :history => "Element history fetches", + :map => "Map API calls", + :upload => "Changeset diff uploads", + :amf => "AMF API calls", + :history => "Element history fetches", :full => "Full element fetches", :trkpts => "GPX trackpoints calls", - :web => "Web site traffic", + :web => "Web site traffic", :other => "Other API calls" } def categorise_uri(line) uri = line.split(" ")[1] - + case uri when /api\/0\.6\/map/ then :map when /api\/0\.6\/changeset\/[0-9]*\/upload/ then :upload @@ -72,7 +72,7 @@ else end h end - + CALL_TYPES.keys.each do |type| count = counts[type] || 0 puts "#{type}.value #{count / delta_t}" diff --git a/cookbooks/munin/files/default/plugins/api_waits_ b/cookbooks/munin/files/default/plugins/api_waits_ index 029c9f4a6..741f190f0 100755 --- a/cookbooks/munin/files/default/plugins/api_waits_ +++ b/cookbooks/munin/files/default/plugins/api_waits_ @@ -5,7 +5,7 @@ require 'date' require 'hpricot' require 'open-uri' -def uri_and_times_from_status(server) +def uri_and_times_from_status(server) file = open("http://#{server}/server-status").read doc = Hpricot.parse(file) tables = doc / 'table' @@ -18,19 +18,19 @@ def uri_and_times_from_status(server) end CALL_TYPES = { - :map => "Map API calls", - :upload => "Changeset diff uploads", - :amf => "AMF API calls", - :history => "Element history fetches", + :map => "Map API calls", + :upload => "Changeset diff uploads", + :amf => "AMF API calls", + :history => "Element history fetches", :full => "Full element fetches", :trkpts => "GPX trackpoints calls", - :web => "Web site traffic", + :web => "Web site traffic", :other => "Other API calls" } def categorise_uri(line) uri = line.split(" ")[1] - + case uri when /api\/0\.6\/map/ then :map when /api\/0\.6\/changeset\/[0-9]*\/upload/ then :upload @@ -63,7 +63,7 @@ else end h end - + CALL_TYPES.keys.each do |type| count = counts[type] || [0] avg = count.inject(0){|x,y|x+y} / (1.0 * count.length) diff --git a/cookbooks/munin/files/default/plugins/passenger_memory b/cookbooks/munin/files/default/plugins/passenger_memory index a894afc90..2ce1a305f 100755 --- a/cookbooks/munin/files/default/plugins/passenger_memory +++ b/cookbooks/munin/files/default/plugins/passenger_memory @@ -1,8 +1,8 @@ #!/usr/bin/env ruby # put in /etc/munin/plugins and restart munin-node # by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin -# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats - +# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats + def output_config puts <<-END graph_args --base 1024 -l 0 --vertical-label bytes --upper-limit 4056231936 @@ -13,9 +13,9 @@ memory.label memory END exit 0 end - + def output_values - status = `/usr/sbin/passenger-memory-stats | tail -1` + status = `/usr/sbin/passenger-memory-stats | tail -1` unless $?.success? $stderr.puts "failed executing passenger-memory-stats" exit 1 @@ -23,10 +23,9 @@ def output_values status =~ /(\d+\.\d+)/ puts "memory.value #{($1.to_f * 1024 * 1024).round}" end - + if ARGV[0] == "config" output_config else output_values end - diff --git a/cookbooks/munin/libraries/expand.rb b/cookbooks/munin/libraries/expand.rb index 9269761f9..081dfc5c1 100644 --- a/cookbooks/munin/libraries/expand.rb +++ b/cookbooks/munin/libraries/expand.rb @@ -1,7 +1,7 @@ class Chef class Munin def self.expand(template, nodes) - nodes.map do |node| + nodes.map do |node| if node.kind_of?(Hash) template.gsub(/%%([^%]+)%%/) { node[$1.to_sym] } else @@ -9,5 +9,5 @@ class Chef end end.join(" ") end - end + end end diff --git a/cookbooks/networking/metadata.rb b/cookbooks/networking/metadata.rb index 64171e545..e74507192 100644 --- a/cookbooks/networking/metadata.rb +++ b/cookbooks/networking/metadata.rb @@ -23,4 +23,3 @@ attribute "networking/nameservers", :description => "List of nameservers to use", :type => "array", :default => [""] - diff --git a/cookbooks/nginx/attributes/default.rb b/cookbooks/nginx/attributes/default.rb index 6e7d56d9b..7e054bd64 100644 --- a/cookbooks/nginx/attributes/default.rb +++ b/cookbooks/nginx/attributes/default.rb @@ -1,2 +1 @@ #default[:nginx][:mpm] = "worker" - diff --git a/cookbooks/nginx/recipes/default.rb b/cookbooks/nginx/recipes/default.rb index 584932166..540e97c24 100644 --- a/cookbooks/nginx/recipes/default.rb +++ b/cookbooks/nginx/recipes/default.rb @@ -33,4 +33,3 @@ service "nginx" do supports :status => true, :restart => true, :reload => true subscribes :restart, "template[/etc/nginx/nginx.conf]" end - diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 682352a6d..ab4e6e15e 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -288,4 +288,3 @@ directory File.dirname(node[:nominatim][:flatnode_file]) do mode 0755 recursive true end - diff --git a/cookbooks/ntp/attributes/default.rb b/cookbooks/ntp/attributes/default.rb index 81ef7aa17..8eccde5fc 100644 --- a/cookbooks/ntp/attributes/default.rb +++ b/cookbooks/ntp/attributes/default.rb @@ -1,4 +1,4 @@ -case platform +case platform when "ubuntu","debian" default[:ntp][:service] = "ntp" when "redhat","centos","fedora" diff --git a/cookbooks/ntp/metadata.rb b/cookbooks/ntp/metadata.rb index 5c7fd630a..6c5ce11e9 100644 --- a/cookbooks/ntp/metadata.rb +++ b/cookbooks/ntp/metadata.rb @@ -32,4 +32,3 @@ attribute "ntp/servers", :description => "Array of servers we should talk to", :type => "array", :default => ["0.us.pool.ntp.org", "1.us.pool.ntp.org"] - diff --git a/cookbooks/piwik/recipes/default.rb b/cookbooks/piwik/recipes/default.rb index 1366d72c9..d711930a1 100644 --- a/cookbooks/piwik/recipes/default.rb +++ b/cookbooks/piwik/recipes/default.rb @@ -68,7 +68,7 @@ template "/opt/piwik-#{version}/piwik/config/config.ini.php" do group "root" mode "0644" variables :passwords => passwords, - :directory => "/opt/piwik-#{version}/piwik", + :directory => "/opt/piwik-#{version}/piwik", :plugins => node[:piwik][:plugins] end diff --git a/cookbooks/planet/files/default/replication-bin/replicate-changesets b/cookbooks/planet/files/default/replication-bin/replicate-changesets index e2d4cc109..8cdc26e7a 100644 --- a/cookbooks/planet/files/default/replication-bin/replicate-changesets +++ b/cookbooks/planet/files/default/replication-bin/replicate-changesets @@ -57,7 +57,7 @@ class Replicator last_run = (@now - 60) if last_run.nil? @state['last_run'] = @now # pretty much all operations on a changeset will modify its closed_at - # time (see rails_port's changeset model). so it is probably enough + # time (see rails_port's changeset model). so it is probably enough # for us to look at anything that was closed recently, and filter from # there. @conn. @@ -66,7 +66,7 @@ class Replicator select {|cs| cs.activity_between?(last_run, @now) } end - # creates an XML file containing the changeset information from the + # creates an XML file containing the changeset information from the # list of changesets output by open_changesets. def changeset_dump(changesets) doc = XML::Document.new @@ -110,7 +110,7 @@ class Replicator doc.root << xml end - + doc.to_s end @@ -150,4 +150,3 @@ end rep = Replicator.new(ARGV[0]) rep.save! - diff --git a/cookbooks/postgresql/providers/table.rb b/cookbooks/postgresql/providers/table.rb index bcd39a959..1c56b63f1 100644 --- a/cookbooks/postgresql/providers/table.rb +++ b/cookbooks/postgresql/providers/table.rb @@ -54,7 +54,7 @@ action :create do new_resource.permissions.each do |user,new_privileges| current_privileges = @current_resource.permissions[user] || {} new_privileges = Array(new_privileges) - + if new_privileges.include?(:all) new_privileges |= Chef::PostgreSQL::TABLE_PRIVILEGES end diff --git a/cookbooks/roundup/recipes/default.rb b/cookbooks/roundup/recipes/default.rb index 25eb0e3c0..5e1c5e88a 100644 --- a/cookbooks/roundup/recipes/default.rb +++ b/cookbooks/roundup/recipes/default.rb @@ -17,4 +17,3 @@ # limitations under the License. # include_recipe "apache" - diff --git a/cookbooks/squid/attributes/default.rb b/cookbooks/squid/attributes/default.rb index 411e61365..990b0dc17 100644 --- a/cookbooks/squid/attributes/default.rb +++ b/cookbooks/squid/attributes/default.rb @@ -2,4 +2,3 @@ default[:squid][:cache_mem] = "256 MB" default[:squid][:cache_dir] = "ufs /var/spool/squid 256 16 256" default[:squid][:access_log] = "/var/log/squid/access.log squid" - diff --git a/cookbooks/tile/files/default/ruby/expire.rb b/cookbooks/tile/files/default/ruby/expire.rb index 4e5cba2db..8bd448a88 100755 --- a/cookbooks/tile/files/default/ruby/expire.rb +++ b/cookbooks/tile/files/default/ruby/expire.rb @@ -9,11 +9,11 @@ require 'mmap' module Expire # projection object to go from latlon -> spherical mercator - PROJ = Proj4::Projection.new(["+proj=merc", "+a=6378137", "+b=6378137", + PROJ = Proj4::Projection.new(["+proj=merc", "+a=6378137", "+b=6378137", "+lat_ts=0.0", "+lon_0=0.0", "+x_0=0.0", - "+y_0=0", "+k=1.0", "+units=m", + "+y_0=0", "+k=1.0", "+units=m", "+nadgrids=@null", "+no_defs +over"]) - + # width/height of the spherical mercator projection SIZE=40075016.6855784 # the size of the meta tile blocks @@ -22,7 +22,7 @@ module Expire HASH_ROOT = "/tiles/default/" # node cache file NODE_CACHE_FILE="/store/database/nodes" - + # turns a spherical mercator coord into a tile coord def Expire.tile_from_merc(point, zoom) # renormalise into unit space [0,1] @@ -34,35 +34,35 @@ module Expire # chop of the fractional parts [point.x.to_int, point.y.to_int, zoom] end - + # turns a latlon -> tile x,y given a zoom level def Expire.tile_from_latlon(latlon, zoom) # first convert to spherical mercator point = PROJ.forward(latlon) tile_from_merc(point, zoom) end - + # this must match the definition of xyz_to_meta in mod_tile def Expire.xyz_to_meta(x, y, z) # mask off the final few bits x &= ~(METATILE - 1) y &= ~(METATILE - 1) # generate the path - hash_path = (0..4).collect { |i| - (((x >> 4*i) & 0xf) << 4) | ((y >> 4*i) & 0xf) + hash_path = (0..4).collect { |i| + (((x >> 4*i) & 0xf) << 4) | ((y >> 4*i) & 0xf) }.reverse.join('/') z.to_s + '/' + hash_path + ".meta" end - + # time to reset to, some very stupidly early time, before OSM started EXPIRY_TIME = Time.parse("2000-01-01 00:00:00") - # expire the meta tile by setting the modified time back + # expire the meta tile by setting the modified time back def Expire.expire_meta(meta) puts "Expiring #{meta}" File.utime(EXPIRY_TIME, EXPIRY_TIME, meta) end - + def Expire.expire(change_file, min_zoom, max_zoom, tile_dirs) do_expire(change_file, min_zoom, max_zoom) do |set| new_set = Set.new @@ -78,11 +78,11 @@ module Expire tile_dirs.each do |tile_dir| meta_set.add(tile_dir + "/" + meta) if File.exist?(tile_dir + "/" + meta) end - + # add the parent into the set for the next round new_set.add([xy[0] / 2, xy[1] / 2, xy[2] - 1]) end - + # expire all meta tiles meta_set.each do |meta| expire_meta(meta) @@ -96,10 +96,10 @@ module Expire def Expire.do_expire(change_file, min_zoom, max_zoom, &_) # read in the osm change file doc = XML::Document.file(change_file) - + # hash map to contain all the nodes nodes = Hash.new - + # we put all the nodes into the hash, as it doesn't matter whether the node was # added, deleted or modified - the tile will need updating anyway. doc.find('//node').each do |node| @@ -110,17 +110,17 @@ module Expire if lat > 85 lat = 85 end - point = Proj4::Point.new(Math::PI * node['lon'].to_f / 180, + point = Proj4::Point.new(Math::PI * node['lon'].to_f / 180, Math::PI * lat / 180) nodes[node['id'].to_i] = tile_from_latlon(point, max_zoom) end - + # now we look for all the ways that have changed and put all of their nodes into # the hash too. this will add too many nodes, as it is possible a long way will be # changed at only a portion of its length. however, due to the non-local way that # mapnik does text placement, it may stil not be enough. # - # also, we miss cases where nodes are deleted from ways where that node is not + # also, we miss cases where nodes are deleted from ways where that node is not # itself deleted and the coverage of the point set isn't enough to encompass the # change. node_cache = NodeCache.new(NODE_CACHE_FILE) @@ -135,12 +135,12 @@ module Expire end end end - - # create a set of all the tiles at the maximum zoom level which are touched by + + # create a set of all the tiles at the maximum zoom level which are touched by # any of the nodes we've collected. we'll create the tiles at other zoom levels # by a simple recursion. set = Set.new nodes.values - + # expire tiles and shrink to the set of parents (max_zoom).downto(min_zoom) do |_| # allow the block to work on the set, returning the set at the next diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index bf5431d06..767b4d3e1 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -213,7 +213,7 @@ node[:tile][:data].each_value do |data| action :create use_conditional_get true else - action :create_if_missing + action :create_if_missing end source url @@ -355,8 +355,8 @@ end "planet_osm_nodes", "planet_osm_rels", "planet_osm_ways", - "raster_columns", - "raster_overviews", + "raster_columns", + "raster_overviews", "spatial_ref_sys" ].each do |table| postgresql_table table do cluster node[:tile][:database][:cluster] @@ -366,10 +366,10 @@ end end end -[ "geometry_columns", - "planet_osm_line", - "planet_osm_point", - "planet_osm_polygon", +[ "geometry_columns", + "planet_osm_line", + "planet_osm_point", + "planet_osm_polygon", "planet_osm_roads" ].each do |table| postgresql_table table do cluster node[:tile][:database][:cluster] diff --git a/cookbooks/tilecache/attributes/default.rb b/cookbooks/tilecache/attributes/default.rb index f5407ad8d..a5a25db11 100644 --- a/cookbooks/tilecache/attributes/default.rb +++ b/cookbooks/tilecache/attributes/default.rb @@ -12,4 +12,3 @@ default[:tilecache][:net_bucket_refill] = "8192" default[:tilecache][:net_bucket_size] = "134217728" default[:tilecache][:ssl][:certificate] = "tile.openstreetmap" - diff --git a/cookbooks/tools/recipes/default.rb b/cookbooks/tools/recipes/default.rb index 34daecf1f..a2245a407 100644 --- a/cookbooks/tools/recipes/default.rb +++ b/cookbooks/tools/recipes/default.rb @@ -54,4 +54,3 @@ end package "whoopsie" do action :purge end - diff --git a/cookbooks/wiki/recipes/default.rb b/cookbooks/wiki/recipes/default.rb index 78f16ed0e..29fa60db5 100644 --- a/cookbooks/wiki/recipes/default.rb +++ b/cookbooks/wiki/recipes/default.rb @@ -32,7 +32,7 @@ mediawiki_site "wiki.openstreetmap.org" do directory "/srv/wiki.openstreetmap.org" enable_ssl TRUE - + database_name "wiki" database_username "wiki-user" database_password passwords["database"] @@ -49,7 +49,7 @@ mediawiki_site "wiki.openstreetmap.org" do recaptcha_public_key "6LdFIQATAAAAAMwtHeI8KDgPqvRbXeNYSq1gujKz" recaptcha_private_key passwords["recaptcha"] - + #site_readonly "MAINTENANCE UPDATE: WIKI READ-ONLY. ETA: Tuesday 8:00am UTC/GMT." end @@ -93,4 +93,3 @@ template "/etc/cron.d/wiki-osm-org-dump" do mode 0644 source "cron_wiki_dump.erb" end - diff --git a/cookbooks/yournavigation/recipes/default.rb b/cookbooks/yournavigation/recipes/default.rb index 4d4580186..ce2c81b7c 100644 --- a/cookbooks/yournavigation/recipes/default.rb +++ b/cookbooks/yournavigation/recipes/default.rb @@ -45,4 +45,3 @@ package "qt4-linguist-tools" package "libicu52" apache_module "php5" - diff --git a/roles/base.rb b/roles/base.rb index 0875bdb4d..b38d5ce16 100644 --- a/roles/base.rb +++ b/roles/base.rb @@ -31,7 +31,7 @@ default_attributes( }, :network_buffers => { :comment => "Tune network buffers", - :parameters => { + :parameters => { "net.core.rmem_max" => "16777216", "net.core.wmem_max" => "16777216", "net.ipv4.tcp_rmem" => "4096\t87380\t16777216", @@ -44,7 +44,7 @@ default_attributes( }, :network_conntrack_established => { :comment => "Only track established connections for four hours", - :parameters => { + :parameters => { "net.netfilter.nf_conntrack_tcp_timeout_established" => "14400" } }, diff --git a/roles/chef-repository.rb b/roles/chef-repository.rb index b9ad2b466..525f619ba 100644 --- a/roles/chef-repository.rb +++ b/roles/chef-repository.rb @@ -14,7 +14,7 @@ default_attributes( }, :chefrepo => { :status => :role, - :members => [ + :members => [ :tomh, :grant, :matt, :jburgess, :lonvia, :yellowbkpk, :bretth ] } diff --git a/roles/db.rb b/roles/db.rb index 47ab5cad9..d5db9a204 100644 --- a/roles/db.rb +++ b/roles/db.rb @@ -13,17 +13,17 @@ default_attributes( :munin => { :plugins => { :postgres_connections_openstreetmap => { - :waiting => { + :waiting => { :warning => 10, :critical => 20 } }, :postgres_locks_openstreetmap => { - :accesssharelock => { + :accesssharelock => { :warning => 900, :critical => 1000 }, - :rowexclusivelock => { + :rowexclusivelock => { :warning => 250, :critical => 300 } diff --git a/roles/dev.rb b/roles/dev.rb index 45670ffcf..84ca09be9 100644 --- a/roles/dev.rb +++ b/roles/dev.rb @@ -66,21 +66,21 @@ default_attributes( :zverik => { :status => :user }, :dodobas => { :status => :user }, :mhohmann => { :status => :user }, - :ooc => { - :status => :role, - :members => [ :tomh, :blackadder, :timsc, :ollie ] + :ooc => { + :status => :role, + :members => [ :tomh, :blackadder, :timsc, :ollie ] }, - :apis => { - :status => :role, - :members => [ :tomh ] + :apis => { + :status => :role, + :members => [ :tomh ] }, - :os => { - :status => :role, - :members => [ :tomh, :grant, :ollie ] + :os => { + :status => :role, + :members => [ :tomh, :grant, :ollie ] }, - :gpsmid => { - :status => :role, - :members => [ :apmon, :maba ] + :gpsmid => { + :status => :role, + :members => [ :apmon, :maba ] } } }, @@ -152,7 +152,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmall" => "4194304", "kernel.shmmax" => "17179869184" } diff --git a/roles/draco.rb b/roles/draco.rb index a5c7d9c20..9bbaddd5c 100644 --- a/roles/draco.rb +++ b/roles/draco.rb @@ -21,7 +21,7 @@ default_attributes( :sysctl => { :tune_cpu_scheduler => { :comment => "Tune CPU scheduler for server scheduling", - :parameters => { + :parameters => { "kernel.sched_migration_cost" => 50000000, "kernel.sched_autogroup_enabled" => 0 } diff --git a/roles/forum.rb b/roles/forum.rb index 701c993ba..3c355851e 100644 --- a/roles/forum.rb +++ b/roles/forum.rb @@ -5,7 +5,7 @@ default_attributes( :accounts => { :users => { :lambertus => { - :status => :administrator + :status => :administrator }, :forum => { :status => :role, diff --git a/roles/ironbelly.rb b/roles/ironbelly.rb index 9a8188449..06876abbb 100644 --- a/roles/ironbelly.rb +++ b/roles/ironbelly.rb @@ -56,7 +56,7 @@ default_attributes( :uid => "tomh", :gid => "tomh", :transfer_logging => false, - :hosts_allow => [ + :hosts_allow => [ "212.110.172.32", # shenron "2001:41c9:1:400::32", # shenron "212.159.112.221" # grant diff --git a/roles/jakelong.rb b/roles/jakelong.rb index 640bd0dd8..7141ed89d 100644 --- a/roles/jakelong.rb +++ b/roles/jakelong.rb @@ -29,7 +29,7 @@ default_attributes( :sysctl => { :kvm => { :comment => "Tuning for KVM guest", - :parameters => { + :parameters => { "kernel.sched_min_granularity_ns" => 10000000, "kernel.sched_wakeup_granularity_ns" => 15000000 } diff --git a/roles/mail.rb b/roles/mail.rb index 73fe22e4a..79c65d0d4 100644 --- a/roles/mail.rb +++ b/roles/mail.rb @@ -67,7 +67,7 @@ default_attributes( :munin => { :plugins => { :exim_mailqueue => { - :mails => { + :mails => { :warning => 500, :critical => 1000 } diff --git a/roles/nadder-01.rb b/roles/nadder-01.rb index c687a9fe8..97e02def6 100644 --- a/roles/nadder-01.rb +++ b/roles/nadder-01.rb @@ -17,7 +17,7 @@ default_attributes( :sysctl => { :kvm => { :comment => "Tuning for KVM guest", - :parameters => { + :parameters => { "kernel.sched_min_granularity_ns" => 10000000, "kernel.sched_wakeup_granularity_ns" => 15000000 } diff --git a/roles/nadder-02.rb b/roles/nadder-02.rb index 1a84ee845..28adbfe8a 100644 --- a/roles/nadder-02.rb +++ b/roles/nadder-02.rb @@ -17,7 +17,7 @@ default_attributes( :sysctl => { :kvm => { :comment => "Tuning for KVM guest", - :parameters => { + :parameters => { "kernel.sched_min_granularity_ns" => 10000000, "kernel.sched_wakeup_granularity_ns" => 15000000 } diff --git a/roles/nepomuk.rb b/roles/nepomuk.rb index b7addd58c..d05a86df1 100644 --- a/roles/nepomuk.rb +++ b/roles/nepomuk.rb @@ -25,7 +25,7 @@ default_attributes( :sysctl => { :kvm => { :comment => "Tuning for KVM guest", - :parameters => { + :parameters => { "kernel.sched_min_granularity_ns" => 10000000, "kernel.sched_wakeup_granularity_ns" => 15000000 } diff --git a/roles/nominatim.rb b/roles/nominatim.rb index f0f2a2dc3..6c7d972cf 100644 --- a/roles/nominatim.rb +++ b/roles/nominatim.rb @@ -37,7 +37,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 26 * 1024 * 1024 * 1024, "kernel.shmall" => 26 * 1024 * 1024 * 1024 / 4096 } @@ -57,7 +57,7 @@ default_attributes( }, :network_conntrack_time_wait => { :comment => "Only track completed connections for 30 seconds", - :parameters => { + :parameters => { "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30" } }, diff --git a/roles/orm.rb b/roles/orm.rb index 9d1653a16..e1b1e5525 100644 --- a/roles/orm.rb +++ b/roles/orm.rb @@ -55,7 +55,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 9 * 1024 * 1024 * 1024, "kernel.shmall" => 9 * 1024 * 1024 * 1024 / 4096 } diff --git a/roles/owl.rb b/roles/owl.rb index 36301c01b..d905e3fb2 100644 --- a/roles/owl.rb +++ b/roles/owl.rb @@ -41,7 +41,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 16 * 1024 * 1024 * 1024, "kernel.shmall" => 16 * 1024 * 1024 * 1024 / 4096 } diff --git a/roles/ramoth.rb b/roles/ramoth.rb index 0b67c085f..7e3a89cc2 100644 --- a/roles/ramoth.rb +++ b/roles/ramoth.rb @@ -54,7 +54,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 66 * 1024 * 1024 * 1024, "kernel.shmall" => 66 * 1024 * 1024 * 1024 / 4096 } diff --git a/roles/smaug.rb b/roles/smaug.rb index 122c4d314..3538f09c7 100644 --- a/roles/smaug.rb +++ b/roles/smaug.rb @@ -22,7 +22,7 @@ default_attributes( }, :sensors_volt => { :contacts => "null", - :volt10 => { + :volt10 => { :warning => "3.11:3.50", :critical => "2.98:3.63" } @@ -52,7 +52,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 17 * 1024 * 1024 * 1024, "kernel.shmall" => 17 * 1024 * 1024 * 1024 / 4096 } diff --git a/roles/stats.rb b/roles/stats.rb index ae2e02b01..9c3290d3b 100644 --- a/roles/stats.rb +++ b/roles/stats.rb @@ -4,12 +4,12 @@ description "Role applied to stats.openstreetmap.org" default_attributes( :stats => { :sites => [ - { + { :name => "planet.openstreetmap.org", :log_pattern => "%YYYY-168-%MM-168-%DD-168.gz", :days => "7" }, - { + { :name => "www.openstreetmap.org", :log_pattern => "*-%YYYY-48-%MM-48-%DD-48.gz", :days => "*" diff --git a/roles/tilecache.rb b/roles/tilecache.rb index 8e1262e81..3a6d7fa55 100644 --- a/roles/tilecache.rb +++ b/roles/tilecache.rb @@ -8,7 +8,7 @@ default_attributes( :sysctl => { :network_conntrack_time_wait => { :comment => "Only track completed connections for 30 seconds", - :parameters => { + :parameters => { "net.netfilter.nf_conntrack_tcp_timeout_time_wait" => "30" } }, @@ -20,7 +20,7 @@ default_attributes( }, :squid_swappiness => { :comment => "Prefer not to swapout to free memory", - :parameters => { + :parameters => { "vm.swappiness" => "30" } } diff --git a/roles/tyan-s7010.rb b/roles/tyan-s7010.rb index 97b5db3de..5d313b8c4 100644 --- a/roles/tyan-s7010.rb +++ b/roles/tyan-s7010.rb @@ -8,7 +8,7 @@ default_attributes( ], :sensors => { "jc42-*" => { - :temps => { + :temps => { "temp1" => { :max => 75 } } }, diff --git a/roles/ucl-wates.rb b/roles/ucl-wates.rb index 7fe47bb43..c611c2079 100644 --- a/roles/ucl-wates.rb +++ b/roles/ucl-wates.rb @@ -22,7 +22,7 @@ default_attributes( :sysctl => { :sack => { :comment => "Disable SACK as the UCL firewall breaks it", - :parameters => { + :parameters => { "net.ipv4.tcp_sack" => "0" } } diff --git a/roles/yevaud.rb b/roles/yevaud.rb index fefef1f72..9f1c7e756 100644 --- a/roles/yevaud.rb +++ b/roles/yevaud.rb @@ -48,13 +48,13 @@ default_attributes( :munin => { :plugins => { :cpu => { - :system => { + :system => { :warning => 500, :critical => 600 } }, :load => { - :load => { + :load => { :warning => 150, :critical => 200 } @@ -84,7 +84,7 @@ default_attributes( :sysctl => { :postgres => { :comment => "Increase shared memory for postgres", - :parameters => { + :parameters => { "kernel.shmmax" => 4 * 1024 * 1024 * 1024, "kernel.shmall" => 4 * 1024 * 1024 * 1024 / 4096 } -- 2.39.5