Start using uWSGI role
Move service to use uWSGI role instead of iternal task for uwsgi deployment. This aims to ease the maintenance of uWSGI and speedup metal deployments as the same uwsgi environment will be used across all services. Change-Id: I8492d52d8155e1bd75f99deb4fd19d445a831816
This commit is contained in:
parent
1f1f34942d
commit
51c0311478
|
@ -40,7 +40,6 @@ barbican_system_user_comment: Barbican System User
|
|||
barbican_system_user_shell: /bin/false
|
||||
barbican_system_user_home: "/var/lib/{{ barbican_system_user_name }}"
|
||||
barbican_etc_directory: /etc/barbican
|
||||
barbican_vassals_directory: "{{ barbican_etc_directory }}/vassals"
|
||||
|
||||
#Barbican services info
|
||||
barbican_api_program_name: barbican-api
|
||||
|
@ -54,11 +53,11 @@ barbican_services:
|
|||
group: barbican_all
|
||||
service_name: barbican
|
||||
init_config_overrides: "{{ barbican_init_config_overrides }}"
|
||||
execstarts: >-
|
||||
{{ barbican_uwsgi_bin }}/uwsgi
|
||||
--master
|
||||
--die-on-term
|
||||
--emperor {{ barbican_vassals_directory }}
|
||||
uwsgi_bind_address: "{{ barbican_service_host }}"
|
||||
uwsgi_port: "{{ barbican_service_port }}"
|
||||
uwsgi_overrides: "{{ barbican_uwsgi_init_overrides }}"
|
||||
wsgi_app: True
|
||||
wsgi_name: barbican-wsgi-api
|
||||
start_order: 1
|
||||
|
||||
## Service Type and Data
|
||||
|
@ -178,7 +177,6 @@ barbican_pip_packages:
|
|||
- PyMySQL
|
||||
- python-memcached
|
||||
- systemd-python
|
||||
- uwsgi
|
||||
barbican_user_pip_packages: []
|
||||
|
||||
barbican_optional_oslomsg_amqp1_pip_packages:
|
||||
|
|
|
@ -35,10 +35,6 @@
|
|||
destination: "{{ barbican_etc_directory }}/api_audit_map.conf"
|
||||
config_overrides: "{{ barbican_api_audit_map_overrides }}"
|
||||
config_type: "ini"
|
||||
- source: "barbican-vassals-api.ini.j2"
|
||||
destination: "{{ barbican_etc_directory }}/vassals/barbican-api.ini"
|
||||
config_overrides: "{{ barbican_vassals_api_overrides }}"
|
||||
config_type: "ini"
|
||||
notify: Restart barbican services
|
||||
|
||||
- name: Implement policy.json if there are overrides configured
|
||||
|
|
|
@ -38,5 +38,4 @@
|
|||
mode: "{{ item.mode |default('0750') }}"
|
||||
with_items:
|
||||
- path: "/etc/barbican"
|
||||
- path: "/etc/barbican/vassals"
|
||||
- path: "{{ barbican_system_user_home }}"
|
||||
|
|
|
@ -110,6 +110,16 @@
|
|||
tags:
|
||||
- barbican-config
|
||||
|
||||
- name: Import uwsgi role
|
||||
import_role:
|
||||
name: uwsgi
|
||||
vars:
|
||||
uwsgi_services: "{{ uwsgi_barbican_services }}"
|
||||
uwsgi_install_method: "{{ barbican_install_method }}"
|
||||
tags:
|
||||
- barbican-config
|
||||
- uwsgi
|
||||
|
||||
- import_tasks: service_setup.yml
|
||||
vars:
|
||||
_service_adminuri_insecure: "{{ keystone_service_adminuri_insecure }}"
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
[uwsgi]
|
||||
socket = :9311
|
||||
protocol = http
|
||||
processes = {{ barbican_wsgi_processes }}
|
||||
threads = {{ barbican_wsgi_threads }}
|
||||
lazy = true
|
||||
vacuum = true
|
||||
no-default-app = true
|
||||
memory-report = true
|
||||
plugins = {{ (barbican_install_method == 'distro' and (ansible_os_family | lower) == 'debian') | ternary('python3', 'python') }}
|
||||
paste = config:/etc/barbican/barbican-api-paste.ini
|
||||
add-header = Connection: close
|
|
@ -55,3 +55,7 @@
|
|||
src: https://opendev.org/openstack/ansible-role-python_venv_build
|
||||
scm: git
|
||||
version: master
|
||||
- name: uwsgi
|
||||
src: https://opendev.org/openstack/ansible-role-uwsgi
|
||||
scm: git
|
||||
version: master
|
||||
|
|
|
@ -32,11 +32,7 @@ barbican_service_distro_packages:
|
|||
- python3-pymysql # needed by /usr/bin/barbican-manage db upgrade.
|
||||
- python-systemd
|
||||
- python3-systemd
|
||||
- uwsgi
|
||||
- uwsgi-plugin-python3
|
||||
|
||||
barbican_oslomsg_amqp1_distro_packages:
|
||||
- libsasl2-modules
|
||||
- sasl2-bin
|
||||
|
||||
barbican_uwsgi_bin: '/usr/bin'
|
||||
|
|
|
@ -23,7 +23,8 @@ filtered_barbican_services: |-
|
|||
{% for key, value in barbican_services.items() %}
|
||||
{% if (value['group'] in group_names) and
|
||||
(('condition' not in value) or
|
||||
('condition' in value and value['condition'])) %}
|
||||
('condition' in value and value['condition'])) and
|
||||
not ('wsgi_app' in value and value['wsgi_app']) %}
|
||||
{% set _ = value.update(
|
||||
{
|
||||
'service_key': key,
|
||||
|
@ -38,6 +39,29 @@ filtered_barbican_services: |-
|
|||
{% endfor %}
|
||||
{{ services | sort(attribute='start_order') }}
|
||||
|
||||
uwsgi_barbican_services: |-
|
||||
{% set services = {} %}
|
||||
{% for key, value in barbican_services.items() %}
|
||||
{% if (value['group'] in group_names) and
|
||||
(('condition' not in value) or
|
||||
('condition' in value and value['condition']))
|
||||
and ('wsgi_app' in value and value['wsgi_app']) %}
|
||||
{% set _ = value.update(
|
||||
{
|
||||
'wsgi_path': barbican_bin ~ '/' ~ value.wsgi_name,
|
||||
'wsgi_venv': ((barbican_install_method == 'source') | ternary(barbican_bin | dirname, None)),
|
||||
'uwsgi_uid': barbican_system_user_name,
|
||||
'uwsgi_guid': barbican_system_group_name,
|
||||
'uwsgi_processes': barbican_wsgi_processes,
|
||||
'uwsgi_threads': barbican_wsgi_threads
|
||||
}
|
||||
)
|
||||
%}
|
||||
{% set _ = services.update({key: value}) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ services }}
|
||||
|
||||
barbican_service_users: |-
|
||||
{% set users = [{
|
||||
'name': barbican_service_user_name,
|
||||
|
|
|
@ -32,12 +32,8 @@ barbican_service_distro_packages:
|
|||
- openstack-barbican-keystone-listener
|
||||
- openstack-barbican-worker
|
||||
- systemd-python
|
||||
- uwsgi
|
||||
- uwsgi-plugin-python
|
||||
|
||||
barbican_oslomsg_amqp1_distro_packages:
|
||||
- cyrus-sasl-lib
|
||||
- cyrus-sasl-plain
|
||||
- cyrus-sasl-md5
|
||||
|
||||
barbican_uwsgi_bin: '/usr/sbin'
|
||||
|
|
|
@ -20,4 +20,3 @@ barbican_package_list: |-
|
|||
{% endif %}
|
||||
{{ packages }}
|
||||
_barbican_bin: "/openstack/venvs/barbican-{{ barbican_venv_tag }}/bin"
|
||||
barbican_uwsgi_bin: "{{ _barbican_bin }}"
|
||||
|
|
|
@ -32,12 +32,8 @@ barbican_service_distro_packages:
|
|||
- openstack-barbican-retry
|
||||
- openstack-barbican-worker
|
||||
- python-systemd
|
||||
- uwsgi
|
||||
- uwsgi-python
|
||||
|
||||
barbican_oslomsg_amqp1_distro_packages:
|
||||
- cyrus-sasl
|
||||
- cyrus-sasl-plain
|
||||
- cyrus-sasl-digestmd5
|
||||
|
||||
barbican_uwsgi_bin: '/usr/sbin'
|
||||
|
|
Loading…
Reference in New Issue