- apache_site "#{name}.dev.openstreetmap.org" do
- template "apache.user.erb"
- directory "#{user_home}/public_html"
- variables :user => name
- end
- end
+ next unless %w(user administrator).include?(details[:status])
+
+ user_home = details[:home] || account["home"] || "#{node[:accounts][:home]}/#{name}"
+
+ next unless File.directory?("#{user_home}/public_html")
+
+ port = 7000 + account["uid"].to_i
+
+ template "/etc/php/7.0/fpm/pool.d/#{name}.conf" do
+ source "fpm.conf.erb"
+ owner "root"
+ group "root"
+ mode 0o644
+ variables :user => name, :port => port
+ notifies :reload, "service[php7.0-fpm]"
+ end
+
+ apache_site "#{name}.dev.openstreetmap.org" do
+ template "apache.user.erb"
+ directory "#{user_home}/public_html"
+ variables :user => name, :port => port
+ end
+
+ template "/etc/sudoers.d/#{name}" do
+ source "sudoers.user.erb"
+ owner "root"
+ group "root"
+ mode 0o440
+ variables :user => name