Execution
Date 14 Dec 2025 10:21:40 +0000
Duration 00:43:55.98
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.13.5
Summary
13 Hosts
2438 Tasks
2413 Results
107 Plays
511 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/ansible-role-uwsgi/tasks/uwsgi_post_install.yml

---
# Copyright 2019, VEXXHOST, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Ensure uWSGI directory exists
  ansible.builtin.file:
    path: "/etc/uwsgi/"
    state: directory
    mode: "0755"

- name: Deploy uWSGI configuration files
  openstack.config_template.config_template:
    src: uwsgi.ini.j2
    dest: "/etc/uwsgi/{{ item.key }}.ini"
    config_type: "ini"
    config_overrides: "{{ item.value.uwsgi_overrides | default({}) | combine(uwsgi_ini_overrides, recursive=True) }}"
  with_dict: "{{ uwsgi_services }}"
  notify:
    - Restart uwsgi services

- name: Run the systemd service role
  ansible.builtin.include_role:
    name: systemd_service
  vars:
    systemd_user_name: "{{ service_var.value.uwsgi_uid | default(uwsgi_system_user_name) }}"
    systemd_group_name: "{{ service_var.value.uwsgi_guid | default(uwsgi_system_group_name) }}"
    systemd_tempd_prefix: openstack
    systemd_slice_name: "{{ uwsgi_system_slice_name }}"
    systemd_lock_dir: "{{ uwsgi_lock_dir }}/{{ service_var.key }}"
    systemd_run_dir: "{{ uwsgi_run_dir }}/{{ service_var.key }}"
    systemd_service_cpu_accounting: true
    systemd_service_block_io_accounting: true
    systemd_service_memory_accounting: true
    systemd_service_tasks_accounting: true
    systemd_services:
      - service_name: "{{ service_var.value.service_name | default(service_var.key) }}"
        enabled: "{{ service_var.value.enabled | default(True) }}"
        state: "{{ service_var.value.state | default('started') }}"
        execstarts: >-
          {{ uwsgi_bin }}/uwsgi --autoload --ini /etc/uwsgi/{{ service_var.key }}.ini
          {{ (service_var.value.uwsgi_pyargv is defined) | ternary('--pyargv "' ~ service_var.value.uwsgi_pyargv | default('') ~ '"', '') }}
        execreloads: "{{ uwsgi_bin }}/uwsgi --reload {{ uwsgi_run_dir }}/{{ service_var.key }}/{{ uwsgi_system_slice_name }}/{{ service_var.key }}.pid"
        config_overrides: "{{ service_var.value.init_config_overrides | default({}) | combine(uwsgi_init_config_overrides, recursive=True) }}"
  with_dict: "{{ uwsgi_services }}"
  loop_control:
    loop_var: service_var