Fix systemd init template for program override

The systemd-init template was not looking at the program_override
variable within each service's dictionary.

This also fixes glance-api so that it's running under uWSGI when the v1
API is disabled. Creating images from a remote URL is exclusive to the
v1 API and does not work when glance-api is run under uWSGI.

The libxml2-dev package is required by uWSGI and has been added to the
distro package list.

Additional options have been added to the uWSGI configuration to better
support requests containing chunked data (image uploads).

Change-Id: I14f3162a4666d770beec9746469021466fa4d449
This commit is contained in:
Jimmy McCrory 2017-12-01 19:06:33 -08:00
parent 3f47dbd361
commit 43aa00424f
6 changed files with 20 additions and 10 deletions

View File

@ -234,12 +234,16 @@ glance_services:
init_config_overrides: "{{ glance_api_init_overrides }}"
start_order: 1
wsgi_overrides: "{{ glance_api_uwsgi_ini_overrides }}"
wsgi_app: True
log_string: "--logto "
wsgi_app: "{{ not glance_enable_v1_api }}"
log_string: "{{ glance_enable_v1_api | ternary('--log-file=', '--logto ') }}"
wsgi_name: glance-wsgi-api
uwsgi_bind_address: "{{ glance_api_bind_address }}"
uwsgi_port: "{{ glance_api_service_port }}"
program_override: "{{ glance_bin }}/uwsgi --ini /etc/uwsgi/glance-api.ini"
program_override: >-
{{ glance_enable_v1_api | ternary(
glance_bin ~ '/glance-api',
glance_bin ~ '/uwsgi --ini /etc/uwsgi/glance-api.ini')
}}
glance-registry:
group: glance_registry
service_name: glance-registry

View File

@ -10,7 +10,7 @@ Type=simple
User={{ glance_system_user_name }}
Group={{ glance_system_group_name }}
{% if program_override is defined %}
{% if item.program_override is defined %}
ExecStart={{ item.program_override }} {{ item.program_config_options | default('') }} {{ item.log_string | default('--log-file=') }}/var/log/glance/{{ item.service_name }}.log
{% else %}
ExecStart={{ glance_bin }}/{{ item.service_name }} {{ item.program_config_options | default('') }} --log-file=/var/log/glance/{{ item.service_name }}.log

View File

@ -17,3 +17,6 @@ add-header = Connection: close
buffer-size = {{ glance_wsgi_buffer_size }}
thunder-lock = true
logfile-chmod = 644
http-auto-chunked = true
http-raw-body = true
socket-timeout = 10

View File

@ -16,8 +16,9 @@
glance_distro_packages:
- cronie
- cronie-anacron
- git
- libxml2-devel
- nfs-utils
- rpcbind
- rsync
- git
- nfs-utils
- which

View File

@ -17,8 +17,9 @@
glance_distro_packages:
- cronie
- cronie-anacron
- git-core
- libxml2-devel
- nfs-utils
- rpcbind
- rsync
- git-core
- nfs-utils
- which

View File

@ -18,7 +18,8 @@ cache_timeout: 600
# Common apt packages
glance_distro_packages:
- git
- libxml2-dev
- nfs-common
- rpcbind
- rsync
- git
- nfs-common