Skip to content

Commit

Permalink
Fix distro installs on Ubuntu
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jimmymccrory committed Jun 5, 2019
1 parent fcfd7bf commit 67db4e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
7 changes: 7 additions & 0 deletions templates/horizon_local_settings.py.j2
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 5 additions & 6 deletions vars/debian.yml
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion vars/distro_install.yml
Expand Up @@ -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

0 comments on commit 67db4e8

Please sign in to comment.