Use python3 packages on Ubuntu
Python2.7 is going EOL soon, let us deploy python3 for Rocky from the start, so we avoid having to switch later. Add a workaround because the apache2::mod_wsgi recipe hardcodes python2 deployment. Install neutron-*aas-dashboard plugins as distro packages and not from pypi. Change-Id: Ia994665c69b64725e7e5369ceb93ee9608620d2b
This commit is contained in:
parent
8f5ef483b9
commit
1fe8dedbab
@ -130,10 +130,10 @@ when 'debian'
|
|||||||
default['openstack']['dashboard']['logout_url'] = nil
|
default['openstack']['dashboard']['logout_url'] = nil
|
||||||
default['openstack']['dashboard']['login_redirect_url'] = nil
|
default['openstack']['dashboard']['login_redirect_url'] = nil
|
||||||
default['openstack']['dashboard']['platform'] = {
|
default['openstack']['dashboard']['platform'] = {
|
||||||
'memcache_python_packages' => ['python-memcache'],
|
'memcache_python_packages' => ['python3-memcache'],
|
||||||
'package_overrides' => '',
|
'package_overrides' => '',
|
||||||
}
|
}
|
||||||
default['openstack']['dashboard']['platform']['horizon_packages'] = ['node-less', 'openstack-dashboard']
|
default['openstack']['dashboard']['platform']['horizon_packages'] = ['node-less', 'libapache2-mod-wsgi-py3', 'python3-django-horizon', 'openstack-dashboard']
|
||||||
default['openstack']['dashboard']['apache']['sites-path'] = "#{node['apache']['dir']}/sites-available/openstack-dashboard.conf"
|
default['openstack']['dashboard']['apache']['sites-path'] = "#{node['apache']['dir']}/sites-available/openstack-dashboard.conf"
|
||||||
else
|
else
|
||||||
default['openstack']['dashboard']['key_group'] = 'root'
|
default['openstack']['dashboard']['key_group'] = 'root'
|
||||||
@ -220,5 +220,3 @@ default['openstack']['dashboard']['neutron']['enable_fwaas'] = false
|
|||||||
# 'varable2': 'value2',
|
# 'varable2': 'value2',
|
||||||
# }
|
# }
|
||||||
default['openstack']['dashboard']['misc_local_settings'] = nil
|
default['openstack']['dashboard']['misc_local_settings'] = nil
|
||||||
# version of python neutron-lbaas-dashboard package to install
|
|
||||||
default['openstack']['dashboard']['lbaas']['version'] = '3.0.1'
|
|
||||||
|
@ -62,7 +62,13 @@ node.normal['apache']['listen'] = apache2_listen.uniq
|
|||||||
|
|
||||||
include_recipe 'apache2'
|
include_recipe 'apache2'
|
||||||
include_recipe 'apache2::mod_headers'
|
include_recipe 'apache2::mod_headers'
|
||||||
include_recipe 'apache2::mod_wsgi'
|
# TODO(jh): hardcoded to include py2 mod-wsgi package
|
||||||
|
# include_recipe 'apache2::mod_wsgi'
|
||||||
|
package 'libapache2-mod-wsgi-py3' do
|
||||||
|
only_if { platform_family?('debian') }
|
||||||
|
end
|
||||||
|
apache_module 'wsgi'
|
||||||
|
|
||||||
include_recipe 'apache2::mod_rewrite'
|
include_recipe 'apache2::mod_rewrite'
|
||||||
include_recipe 'apache2::mod_ssl' if node['openstack']['dashboard']['use_ssl']
|
include_recipe 'apache2::mod_ssl' if node['openstack']['dashboard']['use_ssl']
|
||||||
|
|
||||||
|
@ -17,37 +17,4 @@
|
|||||||
|
|
||||||
include_recipe 'openstack-dashboard::horizon'
|
include_recipe 'openstack-dashboard::horizon'
|
||||||
|
|
||||||
django_path = node['openstack']['dashboard']['django_path']
|
package 'python3-neutron-fwaas-dashboard'
|
||||||
policy_file_path = node['openstack']['dashboard']['policy_files_path']
|
|
||||||
|
|
||||||
python_package 'neutron-fwaas-dashboard'
|
|
||||||
|
|
||||||
%w(
|
|
||||||
_7010_project_firewalls_common.py
|
|
||||||
_7011_project_firewalls_panel.py
|
|
||||||
_7012_project_firewalls_v2_panel.py
|
|
||||||
).each do |file|
|
|
||||||
remote_file "#{django_path}/openstack_dashboard/local/enabled/#{file}" do
|
|
||||||
source "https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/queens/neutron_fwaas_dashboard/enabled/#{file}"
|
|
||||||
owner 'root'
|
|
||||||
mode 0o0644
|
|
||||||
notifies :run, 'execute[neutron-fwaas-dashboard compilemessages]'
|
|
||||||
notifies :run, 'execute[openstack-dashboard collectstatic]'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
remote_file "#{policy_file_path}/neutron-fwaas-policy.json" do
|
|
||||||
source 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/queens/etc/neutron-fwaas-policy.json'
|
|
||||||
owner 'root'
|
|
||||||
mode 0o0644
|
|
||||||
notifies :run, 'execute[neutron-fwaas-dashboard compilemessages]'
|
|
||||||
notifies :run, 'execute[openstack-dashboard collectstatic]'
|
|
||||||
notifies :restart, 'service[apache2]', :delayed
|
|
||||||
end
|
|
||||||
|
|
||||||
execute 'neutron-fwaas-dashboard compilemessages' do
|
|
||||||
cwd django_path
|
|
||||||
environment 'PYTHONPATH' => "/etc/openstack-dashboard:#{django_path}:$PYTHONPATH"
|
|
||||||
command 'python manage.py compilemessages'
|
|
||||||
action :nothing
|
|
||||||
end
|
|
||||||
|
@ -17,17 +17,4 @@
|
|||||||
|
|
||||||
include_recipe 'openstack-dashboard::horizon'
|
include_recipe 'openstack-dashboard::horizon'
|
||||||
|
|
||||||
django_path = node['openstack']['dashboard']['django_path']
|
package 'python3-neutron-lbaas-dashboard'
|
||||||
|
|
||||||
python_package 'neutron-lbaas-dashboard' do
|
|
||||||
version node['openstack']['dashboard']['lbaas']['version']
|
|
||||||
notifies :run, 'execute[restore-selinux-context]', :immediately
|
|
||||||
notifies :run, 'execute[openstack-dashboard collectstatic]'
|
|
||||||
end
|
|
||||||
|
|
||||||
remote_file "#{django_path}/openstack_dashboard/local/enabled/_1481_project_ng_loadbalancersv2_panel.py" do
|
|
||||||
source 'https://raw.githubusercontent.com/openstack/neutron-lbaas-dashboard/stable/queens/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py'
|
|
||||||
owner 'root'
|
|
||||||
mode 0o0644
|
|
||||||
notifies :run, 'execute[openstack-dashboard collectstatic]'
|
|
||||||
end
|
|
||||||
|
@ -69,7 +69,6 @@ describe 'openstack-dashboard::apache2-server' do
|
|||||||
it 'includes apache packages' do
|
it 'includes apache packages' do
|
||||||
%w(apache2
|
%w(apache2
|
||||||
apache2::mod_headers
|
apache2::mod_headers
|
||||||
apache2::mod_wsgi
|
|
||||||
apache2::mod_rewrite
|
apache2::mod_rewrite
|
||||||
apache2::mod_ssl).each do |recipe|
|
apache2::mod_ssl).each do |recipe|
|
||||||
expect(chef_run).to include_recipe(recipe)
|
expect(chef_run).to include_recipe(recipe)
|
||||||
|
@ -19,8 +19,10 @@ describe 'openstack-dashboard::horizon' do
|
|||||||
|
|
||||||
it 'installs packages' do
|
it 'installs packages' do
|
||||||
expect(chef_run).to upgrade_package('node-less')
|
expect(chef_run).to upgrade_package('node-less')
|
||||||
|
expect(chef_run).to upgrade_package('libapache2-mod-wsgi-py3')
|
||||||
|
expect(chef_run).to upgrade_package('python3-django-horizon')
|
||||||
expect(chef_run).to upgrade_package('openstack-dashboard')
|
expect(chef_run).to upgrade_package('openstack-dashboard')
|
||||||
expect(chef_run).to upgrade_package('python-mysqldb')
|
expect(chef_run).to upgrade_package('python3-mysqldb')
|
||||||
end
|
end
|
||||||
|
|
||||||
describe 'local_settings.py' do
|
describe 'local_settings.py' do
|
||||||
|
@ -17,46 +17,7 @@ describe 'openstack-dashboard::neutron-fwaas-dashboard' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
expect(chef_run).to install_python_package('neutron-fwaas-dashboard')
|
expect(chef_run).to install_package('python3-neutron-fwaas-dashboard')
|
||||||
end
|
|
||||||
|
|
||||||
%w(
|
|
||||||
_7010_project_firewalls_common.py
|
|
||||||
_7011_project_firewalls_panel.py
|
|
||||||
_7012_project_firewalls_v2_panel.py
|
|
||||||
).each do |file|
|
|
||||||
it do
|
|
||||||
expect(chef_run).to create_remote_file(
|
|
||||||
"#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/#{file}"
|
|
||||||
).with(
|
|
||||||
mode: 0o0644,
|
|
||||||
owner: 'root',
|
|
||||||
source: "https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/queens/neutron_fwaas_dashboard/enabled/#{file}"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
|
||||||
expect(chef_run.remote_file("#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/#{file}"))
|
|
||||||
.to notify('execute[openstack-dashboard collectstatic]').to(:run)
|
|
||||||
notify('execute[neutron-fwaas-dashboard compilemessages]').to(:run)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
|
||||||
expect(chef_run).to create_remote_file(
|
|
||||||
"#{node['openstack']['dashboard']['policy_files_path']}/neutron-fwaas-policy.json"
|
|
||||||
).with(
|
|
||||||
mode: 0o0644,
|
|
||||||
owner: 'root',
|
|
||||||
source: 'https://raw.githubusercontent.com/openstack/neutron-fwaas-dashboard/stable/queens/etc/neutron-fwaas-policy.json'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
|
||||||
expect(chef_run.remote_file("#{node['openstack']['dashboard']['policy_files_path']}/neutron-fwaas-policy.json"))
|
|
||||||
.to notify('execute[openstack-dashboard collectstatic]').to(:run)
|
|
||||||
notify('execute[neutron-fwaas-dashboard compilemessages]').to(:run)
|
|
||||||
notify('service[apache2]').to(:restart).delayed
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -17,22 +17,7 @@ describe 'openstack-dashboard::neutron-lbaas-dashboard' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it do
|
it do
|
||||||
expect(chef_run).to install_python_package('neutron-lbaas-dashboard')
|
expect(chef_run).to install_package('python3-neutron-lbaas-dashboard')
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
|
||||||
expect(chef_run).to create_remote_file(
|
|
||||||
"#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/_1481_project_ng_loadbalancersv2_panel.py"
|
|
||||||
).with(
|
|
||||||
mode: 0o0644,
|
|
||||||
owner: 'root',
|
|
||||||
source: 'https://raw.githubusercontent.com/openstack/neutron-lbaas-dashboard/stable/queens/neutron_lbaas_dashboard/enabled/_1481_project_ng_loadbalancersv2_panel.py'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
it do
|
|
||||||
expect(chef_run.remote_file("#{node['openstack']['dashboard']['django_path']}/openstack_dashboard/local/enabled/_1481_project_ng_loadbalancersv2_panel.py"))
|
|
||||||
.to notify('execute[openstack-dashboard collectstatic]')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user