action [ :enable, :start ]
supports :status => true, :restart => true, :reload => true
end
action [ :enable, :start ]
supports :status => true, :restart => true, :reload => true
end
search(:accounts, "*:*").each do |account|
name = account["id"]
details = node[:accounts][:users][name] || {}
search(:accounts, "*:*").each do |account|
name = account["id"]
details = node[:accounts][:users][name] || {}
if ["user","administrator"].include?(details[:status])
user_home = details[:home] || account["home"] || "#{node[:accounts][:home]}/#{name.to_s}"
if ["user","administrator"].include?(details[:status])
user_home = details[:home] || account["home"] || "#{node[:accounts][:home]}/#{name.to_s}"
notifies :reload, "service[php5-fpm]"
end
apache_site "#{name}.dev.openstreetmap.org" do
template "apache.user.erb"
directory "#{user_home}/public_html"
notifies :reload, "service[php5-fpm]"
end
apache_site "#{name}.dev.openstreetmap.org" do
template "apache.user.erb"
directory "#{user_home}/public_html"
site_name = "#{name}.apis.dev.openstreetmap.org"
site_aliases = details[:aliases] || []
rails_directory = "/srv/#{name}.apis.dev.openstreetmap.org"
site_name = "#{name}.apis.dev.openstreetmap.org"
site_aliases = details[:aliases] || []
rails_directory = "/srv/#{name}.apis.dev.openstreetmap.org"
end
end
Dir.glob("/srv/*.apis.dev.openstreetmap.org").each do |rails_directory|
name = File.basename(rails_directory, ".apis.dev.openstreetmap.org")
end
end
Dir.glob("/srv/*.apis.dev.openstreetmap.org").each do |rails_directory|
name = File.basename(rails_directory, ".apis.dev.openstreetmap.org")
database_config = YAML.load_file("#{rails_directory}/config/database.yml")
database_name = database_config["production"]["database"]
site_name = "#{name}.apis.dev.openstreetmap.org"
database_config = YAML.load_file("#{rails_directory}/config/database.yml")
database_name = database_config["production"]["database"]
site_name = "#{name}.apis.dev.openstreetmap.org"