Merge "Configure Apache to proxy for Uwsgi"
This commit is contained in:
commit
6b3af85bf2
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Introduced option to deploy Keystone under Uwsgi. A new variable
|
||||||
|
``keystone_mod_wsgi_enabled`` is introduced to toggle this
|
||||||
|
behavior. The ports used by Uwsgi for socket and http connection
|
||||||
|
for both public and admin Keystone services are configurable
|
||||||
|
(see also the ``keystone_uwsgi_ports`` dictionary variable).
|
||||||
|
Federation features should be considered _experimental_ with
|
||||||
|
this configuration at this time. The default is ``true`` which
|
||||||
|
continues to deploy with mod_wsgi for Apache.
|
||||||
|
- Introduced option to deploy Keystone behind Nginx. A new
|
||||||
|
variable ``keystone_apache_enabled`` is introduced to toggle
|
||||||
|
this behavior. Additional configuration can be delivered to
|
||||||
|
Nginx through the use of the ``keystone_nginx_extra_conf`` list
|
||||||
|
variable. Federation features are not supported with this
|
||||||
|
configuration at this time. Use of this option requires
|
||||||
|
``keystone_mod_wsgi_enabled`` to be set to ``false`` which will
|
||||||
|
deploy Keystone under Uwsgi. The default is ``true`` which
|
||||||
|
continues to deploy with Apache.
|
@ -53,7 +53,20 @@
|
|||||||
retries: 5
|
retries: 5
|
||||||
delay: 2
|
delay: 2
|
||||||
with_items: "{{ keystone_mod_wsgi_distro_packages }}"
|
with_items: "{{ keystone_mod_wsgi_distro_packages }}"
|
||||||
when: keystone_mod_wsgi_enabled | bool
|
when:
|
||||||
|
- keystone_mod_wsgi_enabled | bool
|
||||||
|
|
||||||
|
- name: Install mod_proxy_uwsgi apt packages
|
||||||
|
apt:
|
||||||
|
pkg: "{{ item }}"
|
||||||
|
state: "{{ keystone_package_state }}"
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items: "{{ keystone_mod_proxy_uwsgi_distro_packages }}"
|
||||||
|
when:
|
||||||
|
- not keystone_mod_wsgi_enabled | bool
|
||||||
|
|
||||||
- name: Install Nginx apt packages
|
- name: Install Nginx apt packages
|
||||||
apt:
|
apt:
|
||||||
|
@ -70,6 +70,18 @@
|
|||||||
when:
|
when:
|
||||||
- keystone_mod_wsgi_enabled | bool
|
- keystone_mod_wsgi_enabled | bool
|
||||||
|
|
||||||
|
- name: Install mod_proxy_uwsgi apt packages
|
||||||
|
yum:
|
||||||
|
pkg: "{{ item }}"
|
||||||
|
state: "{{ keystone_package_state }}"
|
||||||
|
register: install_packages
|
||||||
|
until: install_packages|success
|
||||||
|
retries: 5
|
||||||
|
delay: 2
|
||||||
|
with_items: "{{ keystone_mod_proxy_uwsgi_distro_packages }}"
|
||||||
|
when:
|
||||||
|
- not keystone_mod_wsgi_enabled | bool
|
||||||
|
|
||||||
- name: Install Nginx yum packages
|
- name: Install Nginx yum packages
|
||||||
yum:
|
yum:
|
||||||
pkg: "{{ item }}"
|
pkg: "{{ item }}"
|
||||||
|
@ -57,12 +57,16 @@
|
|||||||
WSGIScriptAliasMatch ^(/v3/OS-FEDERATION/identity_providers/.*?/protocols/.*?/auth)$ /var/www/cgi-bin/keystone/main/$1
|
WSGIScriptAliasMatch ^(/v3/OS-FEDERATION/identity_providers/.*?/protocols/.*?/auth)$ /var/www/cgi-bin/keystone/main/$1
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if keystone_mod_wsgi_enabled | bool -%}
|
||||||
<Directory /var/www/cgi-bin/keystone>
|
<Directory /var/www/cgi-bin/keystone>
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
allow from all
|
allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
{% else %}
|
||||||
|
ProxyPass / uwsgi://127.0.0.1:{{ keystone_uwsgi_ports[keystone-wsgi-public]["socket"] }}/
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
|
||||||
@ -97,10 +101,19 @@
|
|||||||
SSLOptions +StdEnvVars +ExportCertData
|
SSLOptions +StdEnvVars +ExportCertData
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if keystone_mod_wsgi_enabled | bool -%}
|
||||||
<Directory /var/www/cgi-bin/keystone>
|
<Directory /var/www/cgi-bin/keystone>
|
||||||
Options Indexes FollowSymLinks MultiViews
|
Options Indexes FollowSymLinks MultiViews
|
||||||
AllowOverride All
|
AllowOverride All
|
||||||
Order allow,deny
|
Order allow,deny
|
||||||
allow from all
|
allow from all
|
||||||
</Directory>
|
</Directory>
|
||||||
|
{% else -%}
|
||||||
|
ProxyPass / uwsgi://127.0.0.1:{{ keystone_uwsgi_ports[keystone-wsgi-admin]["socket"] }}/
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
{% if not keystone_mod_wsgi_enabled | bool -%}
|
||||||
|
ProxyPass /identity uwsgi://127.0.0.1:{{ keystone_uwsgi_ports[keystone-wsgi-public]['socket'] }}/
|
||||||
|
ProxyPass /identity_admin uwsgi://127.0.0.1:{{ keystone_uwsgi_ports[keystone-wsgi-admin]['socket'] }}/
|
||||||
|
{% endif %}
|
||||||
|
24
tox.ini
24
tox.ini
@ -175,6 +175,30 @@ commands =
|
|||||||
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
|
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
|
||||||
|
|
||||||
|
|
||||||
|
[testenv:func_uwsgi_apache]
|
||||||
|
# Ignore_errors is set to true so that the logs are collected at the
|
||||||
|
# end of the run. This will not produce a failse positive. Any
|
||||||
|
# exception will be mark the run as "failed" and exit 1 after all of
|
||||||
|
# the commands have been iterated through.
|
||||||
|
ignore_errors = True
|
||||||
|
# NOTE(stevelle): this will test keystone with uwsgi & apache
|
||||||
|
install_command =
|
||||||
|
{[testenv:func_base]install_command}
|
||||||
|
deps =
|
||||||
|
{[testenv:ansible]deps}
|
||||||
|
setenv =
|
||||||
|
{[testenv:ansible]setenv}
|
||||||
|
commands =
|
||||||
|
{[testenv:ansible]commands}
|
||||||
|
ansible-playbook -i {toxinidir}/tests/inventory \
|
||||||
|
-e "rolename={toxinidir}" \
|
||||||
|
-e "install_test_packages=True" \
|
||||||
|
-e "keystone_mod_wsgi_enabled=False" \
|
||||||
|
{toxinidir}/tests/test.yml -vvvv
|
||||||
|
bash -c 'mkdir -p {toxinidir}/logs'
|
||||||
|
bash -c 'rsync -av --ignore-errors /var/log/ /openstack/log/ {toxinidir}/logs/ || true'
|
||||||
|
|
||||||
|
|
||||||
[testenv:func_uwsgi_nginx]
|
[testenv:func_uwsgi_nginx]
|
||||||
# Ignore_errors is set to true so that the logs are collected at the
|
# Ignore_errors is set to true so that the logs are collected at the
|
||||||
# end of the run. This will not produce a failse positive. Any
|
# end of the run. This will not produce a failse positive. Any
|
||||||
|
@ -44,6 +44,9 @@ keystone_apache_distro_packages:
|
|||||||
keystone_mod_wsgi_distro_packages:
|
keystone_mod_wsgi_distro_packages:
|
||||||
- mod_wsgi
|
- mod_wsgi
|
||||||
|
|
||||||
|
keystone_mod_proxy_uwsgi_distro_packages:
|
||||||
|
- mod_proxy_uwsgi
|
||||||
|
|
||||||
keystone_nginx_distro_packages:
|
keystone_nginx_distro_packages:
|
||||||
- nginx
|
- nginx
|
||||||
|
|
||||||
|
@ -36,6 +36,9 @@ keystone_apache_distro_packages:
|
|||||||
keystone_mod_wsgi_distro_packages:
|
keystone_mod_wsgi_distro_packages:
|
||||||
- libapache2-mod-wsgi
|
- libapache2-mod-wsgi
|
||||||
|
|
||||||
|
keystone_mod_proxy_uwsgi_distro_packages:
|
||||||
|
- libapache2-mod-proxy-uwsgi
|
||||||
|
|
||||||
keystone_nginx_distro_packages:
|
keystone_nginx_distro_packages:
|
||||||
- nginx-full
|
- nginx-full
|
||||||
|
|
||||||
|
@ -36,6 +36,9 @@ keystone_apache_distro_packages:
|
|||||||
keystone_mod_wsgi_distro_packages:
|
keystone_mod_wsgi_distro_packages:
|
||||||
- libapache2-mod-wsgi
|
- libapache2-mod-wsgi
|
||||||
|
|
||||||
|
keystone_mod_proxy_uwsgi_distro_packages:
|
||||||
|
- libapache2-mod-proxy-uwsgi
|
||||||
|
|
||||||
keystone_nginx_distro_packages:
|
keystone_nginx_distro_packages:
|
||||||
- nginx-full
|
- nginx-full
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user