Fix distro installs on Ubuntu

Beginning in the Stein release, Ubuntu distro packages are now using
Python3. Conflicting packages have been removed or updated to their
Python3 equivalents. The 'horizon_manage' variable has been updated to
ensure that python3 is used to run manage.py commands.

Values for STATIC_ROOT and LOCALE_PATHS have also been added to the
local_settings.py template. Defaults for these settings are defined
in the setting.py provided by Ubuntu packages, but those defaults
required the 'Collect and compress static files' and 'Compile messages'
tasks be run by the root user, instead of horizon. STATIC_ROOT also
needed to correlate to the folder apache is configured to serve.

Change-Id: Iaa41593e3a91640bd9c5d531da8238c04d7e747b
This commit is contained in:
Jimmy McCrory 2019-06-05 13:58:39 -07:00
parent fcfd7bfcbb
commit 67db4e81a9
3 changed files with 15 additions and 7 deletions

View File

@ -13,6 +13,8 @@ pymysql.install_as_MySQLdb()
DEBUG = {{ debug }}
TEMPLATE_DEBUG = DEBUG
STATIC_ROOT = '{{ horizon_lib_dir }}/static'
# Django Compressor Settings. For more information, see:
# http://django-compressor.readthedocs.org/en/latest/settings/
COMPRESS_OFFLINE = True
@ -180,6 +182,11 @@ AVAILABLE_REGIONS = [
]
{% endif %}
LOCALE_PATHS = [
'horizon/locale',
'openstack_dashboard/locale',
]
OPENSTACK_KEYSTONE_URL = "{{ horizon_keystone_endpoint }}"
# The default role assigned to users

View File

@ -29,14 +29,13 @@ horizon_distro_packages:
- apache2-utils
- cron # required by the Ansible cron module
- gettext
- libapache2-mod-wsgi
- libapache2-mod-wsgi-py3
horizon_service_distro_packages:
- openstack-dashboard
- python-django-openstack-auth
- python-django-horizon
- python-memcache
- python-pymysql
- python3-django-openstack-auth
- python3-django-horizon
- python3-memcache
- python3-pymysql
horizon_apache_conf: "/etc/apache2/apache2.conf"
horizon_apache_default_log_folder: "/var/log/apache2"

View File

@ -16,4 +16,6 @@
horizon_package_list: "{{ horizon_distro_packages + horizon_service_distro_packages }}"
_horizon_bin: "/usr/bin"
horizon_manage: "{{ ansible_python.executable }} {{ horizon_lib_dir }}/manage.py"
horizon_manage: >-
{{ ((ansible_os_family | lower) == 'debian') | ternary('/usr/bin/python3', ansible_python.executable) }}
{{ horizon_lib_dir }}/manage.py