Fixes for Ubuntu: template file generation, diectory permission fix

is it enough to do that for /var/lib/openstack/dashboard/local ? doing it for the webroot is kind of insecure..