]> git.openstreetmap.org Git - chef.git/commitdiff
Move account details to a data bag
authorTom Hughes <tom@compton.nu>
Tue, 18 Jun 2013 18:49:13 +0000 (19:49 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 18 Jun 2013 18:49:13 +0000 (19:49 +0100)
cookbooks/dev/recipes/default.rb

index 33de91afbd091b5acc9e36061edf4a41d90bbf64..39f99f6c71ccd05614f17d0f692d71036051c48d 100644 (file)
@@ -103,9 +103,12 @@ apache_site "phppgadmin.dev.openstreetmap.org" do
   template "apache.phppgadmin.erb"
 end
 
-node[:accounts][:users].each do |name,details|
+search(:accounts, "*:*").each do |account|
+  name = account["id"]
+  details = node[:accounts][:users][name]
+
   if ["user","administrator"].include?(details[:status])
-    user_home = details[:home] || "#{node[:accounts][:home]}/#{name.to_s}"
+    user_home = details[:home] || account["home"] || "#{node[:accounts][:home]}/#{name.to_s}"
 
     if File.directory?("#{user_home}/public_html")
       template "/etc/php5/fpm/pool.d/#{name}.conf" do