node[:osqa][:sites].each do |site|
name = site[:name]
directory = site[:directory] || "/srv/#{name}"
- osqa_revision = site[:revision] || node[:osqa][:revision]
site_user = site[:user] || node[:osqa][:user]
site_user = Etc.getpwuid(site_user).name if site_user.is_a?(Integer)
site_group = site[:group] || node[:osqa][:group] || Etc.getpwnam(site_user).gid
line.gsub!(/^( *)'PASSWORD': '.*',/, "\\1'PASSWORD': '#{database_password}',")
line.gsub!(/^ALLOWED_HOSTS = .*/, "ALLOWED_HOSTS = ('help.openstreetmap.org',)")
line.gsub!(/^CACHE_BACKEND = .*/, "CACHE_BACKEND = 'memcached://127.0.0.1:11211/'")
- line.gsub!(/^APP_URL = 'http:\/\/'/, "APP_URL = 'http://#{name}'")
- line.gsub!(/^TIME_ZONE = 'America\/New_York'/, "TIME_ZONE = 'Europe/London'")
+ line.gsub!(%r{^APP_URL = 'http://'}, "APP_URL = 'http://#{name}'")
+ line.gsub!(%r{^TIME_ZONE = 'America/New_York'}, "TIME_ZONE = 'Europe/London'")
line.gsub!(/^DISABLED_MODULES = \[([^\]]+)\]/, "DISABLED_MODULES = [\\1, 'localauth', 'facebookauth', 'oauthauth']")
line