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: I1e7d6a9fa87f18ce2515e28a5f3df4f6ad01b485
Signed-off-by: Ivan Anfimov <lazekteam@gmail.com>
This commit is contained in:
Ivan Anfimov
2026-06-07 19:16:32 +00:00
parent a5d3e7e77d
commit de02bd9e3d
5 changed files with 54 additions and 6 deletions
+15
View File
@@ -236,6 +236,7 @@ designate_producer_init_overrides: {}
designate_mdns_init_overrides: {}
designate_sink_init_overrides: {}
designate_api_init_overrides: {}
designate_api_uwsgi_ini_overrides: {}
## Service Name-Group Mapping
designate_services:
@@ -274,8 +275,22 @@ designate_services:
service_name: designate-api
init_config_overrides: "{{ designate_api_init_overrides }}"
execstarts: "{{ designate_bin }}/designate-api"
wsgi_app: true
wsgi: "designate.wsgi.api:application"
uwsgi_overrides: "{{ designate_api_uwsgi_ini_overrides }}"
uwsgi_bind_address: "{{ designate_bind_address }}"
uwsgi_port: "{{ designate_service_port }}"
uwsgi_tls: "{{ designate_backend_ssl | ternary(designate_uwsgi_tls, {}) }}"
start_order: 1
# Designate uWSGI settings
designate_wsgi_processes_max: 16
designate_wsgi_processes: "{{ [[ansible_processor_vcpus | default(1), 1] | max * 2, designate_wsgi_processes_max] | min }}"
designate_wsgi_threads: 1
designate_uwsgi_tls:
crt: "{{ designate_ssl_cert }}"
key: "{{ designate_ssl_key }}"
## Tunable overrides
designate_policy_overrides: {}
designate_designate_conf_overrides: {}
+3 -1
View File
@@ -55,7 +55,9 @@
group: "root"
config_overrides: "{{ designate_rootwrap_conf_overrides }}"
config_type: "ini"
notify: Restart designate services
notify:
- Restart designate services
- Restart uwsgi services
- name: Implement policy.yaml if there are overrides configured
openstack.config_template.config_template:
+10
View File
@@ -185,6 +185,16 @@
- designate-config
- systemd-service
- name: Import uwsgi role
ansible.builtin.import_role:
name: uwsgi
vars:
uwsgi_services: "{{ uwsgi_designate_services }}"
uwsgi_install_method: "{{ designate_install_method }}"
tags:
- designate-config
- uwsgi
- name: Flush handlers
ansible.builtin.meta: flush_handlers
- name: Importing designate_db_sync tasks
+4 -4
View File
@@ -19,10 +19,6 @@
src: https://opendev.org/openstack/openstack-ansible-lxc_container_create
scm: git
version: master
- name: galera_client
src: https://opendev.org/openstack/openstack-ansible-galera_client
scm: git
version: master
- name: galera_server
src: https://opendev.org/openstack/openstack-ansible-galera_server
scm: git
@@ -51,3 +47,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
+22 -1
View File
@@ -47,7 +47,8 @@ filtered_designate_services: |-
{% for key, value in designate_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,
@@ -63,6 +64,26 @@ filtered_designate_services: |-
{% endfor %}
{{ services | sort(attribute='start_order') }}
uwsgi_designate_services: |-
{% set services = {} %}
{% for key, value in designate_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_venv': designate_bin | dirname,
'uwsgi_uid': designate_system_user_name,
'uwsgi_guid': designate_system_group_name,
'uwsgi_processes': designate_wsgi_processes,
'uwsgi_threads': designate_wsgi_threads
}
) %}
{% set _ = services.update({key: value}) %}
{% endif %}
{% endfor %}
{{ services }}
_designate_coordination_url: >-
{{ designate_coordination_driver }}://{{
groups[designate_coordination_group]