Add foreman template and fix permissions.