|
27 | 27 | include_recipe "apache2::mod_ssl"
|
28 | 28 | end
|
29 | 29 |
|
30 |
| -unless node[:nova_dashboard][:use_gitrepo] |
31 |
| - if %w(debian ubuntu).include?(node.platform) |
32 |
| - # Explicitly added client dependencies for now. |
33 |
| - packages = [ "python-lesscpy", "python-ply", "openstack-dashboard", "python-novaclient", "python-glance", "python-swift", "python-keystone", "openstackx", "python-django", "python-django-horizon", "python-django-nose" ] |
34 |
| - packages.each do |pkg| |
35 |
| - package pkg do |
36 |
| - action :install |
37 |
| - end |
| 30 | +if %w(debian ubuntu).include?(node.platform) |
| 31 | + # Explicitly added client dependencies for now. |
| 32 | + packages = [ "python-lesscpy", "python-ply", "openstack-dashboard", "python-novaclient", "python-glance", "python-swift", "python-keystone", "openstackx", "python-django", "python-django-horizon", "python-django-nose" ] |
| 33 | + packages.each do |pkg| |
| 34 | + package pkg do |
| 35 | + action :install |
38 | 36 | end
|
| 37 | + end |
39 | 38 |
|
40 |
| - rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ] |
41 |
| - rm_pkgs.each do |pkg| |
42 |
| - package pkg do |
43 |
| - action :purge |
44 |
| - end |
45 |
| - end |
46 |
| - elsif %w(redhat centos).include?(node.platform) |
47 |
| - package "openstack-dashboard" |
48 |
| - package "python-lesscpy" |
49 |
| - package "python-memcached" |
50 |
| - else |
51 |
| - # On SUSE, the package has the correct list of dependencies |
52 |
| - package "openstack-dashboard" |
53 |
| - |
54 |
| - # Install the configured branding |
55 |
| - unless node[:nova_dashboard][:site_theme].empty? |
56 |
| - package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do |
57 |
| - action :install |
58 |
| - notifies :reload, resources(:service => "apache2") |
59 |
| - end |
| 39 | + rm_pkgs = [ "openstack-dashboard-ubuntu-theme" ] |
| 40 | + rm_pkgs.each do |pkg| |
| 41 | + package pkg do |
| 42 | + action :purge |
60 | 43 | end
|
61 | 44 | end
|
| 45 | +elsif %w(redhat centos).include?(node.platform) |
| 46 | + package "openstack-dashboard" |
| 47 | + package "python-lesscpy" |
| 48 | + package "python-memcached" |
62 | 49 | else
|
63 |
| - venv_path = node[:nova_dashboard][:use_virtualenv] ? "#{dashboard_path}/.venv" : nil |
64 |
| - venv_prefix = node[:nova_dashboard][:use_virtualenv] ? ". #{venv_path}/bin/activate &&" : nil |
65 |
| - |
66 |
| - pfs_and_install_deps "nova_dashboard" do |
67 |
| - path dashboard_path |
68 |
| - virtualenv venv_path |
69 |
| - end |
70 |
| - |
71 |
| - execute "chown_#{node[:apache][:user]}" do |
72 |
| - command "chown -R #{node[:apache][:user]}:#{node[:apache][:group]} #{dashboard_path}" |
| 50 | + # On SUSE, the package has the correct list of dependencies |
| 51 | + package "openstack-dashboard" |
| 52 | + |
| 53 | + # Install the configured branding |
| 54 | + unless node[:nova_dashboard][:site_theme].empty? |
| 55 | + package "openstack-dashboard-theme-#{node[:nova_dashboard][:site_theme]}" do |
| 56 | + action :install |
| 57 | + notifies :reload, resources(:service => "apache2") |
| 58 | + end |
73 | 59 | end
|
74 | 60 | end
|
75 | 61 |
|
|
257 | 243 | execute "python manage.py syncdb" do
|
258 | 244 | cwd dashboard_path
|
259 | 245 | environment ({'PYTHONPATH' => dashboard_path})
|
260 |
| - command "#{venv_prefix} python manage.py syncdb --noinput" |
| 246 | + command "python manage.py syncdb --noinput" |
261 | 247 | user node[:apache][:user]
|
262 | 248 | group node[:apache][:group]
|
263 | 249 | action :nothing
|
|
341 | 327 | :use_ssl => node[:nova_dashboard][:apache][:ssl],
|
342 | 328 | :ssl_crt_file => node[:nova_dashboard][:apache][:ssl_crt_file],
|
343 | 329 | :ssl_key_file => node[:nova_dashboard][:apache][:ssl_key_file],
|
344 |
| - :ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file], |
345 |
| - :venv => node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo], |
346 |
| - :venv_path => venv_path |
| 330 | + :ssl_crt_chain_file => node[:nova_dashboard][:apache][:ssl_crt_chain_file] |
347 | 331 | )
|
348 | 332 | if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/nova-dashboard.conf") or node.platform == "suse"
|
349 | 333 | notifies :reload, resources(:service => "apache2")
|
350 | 334 | end
|
351 | 335 | end
|
352 | 336 |
|
353 |
| -if node[:nova_dashboard][:use_virtualenv] && node[:nova_dashboard][:use_gitrepo] |
354 |
| - template "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django_venv.wsgi" do |
355 |
| - source "django_venv.wsgi.erb" |
356 |
| - mode 0644 |
357 |
| - variables( |
358 |
| - :venv_path => venv_path |
359 |
| - ) |
360 |
| - end |
361 |
| -end |
362 |
| - |
363 | 337 | apache_site "nova-dashboard.conf" do
|
364 | 338 | enable true
|
365 | 339 | end
|
|
0 commit comments