Execution
Date 08 Dec 2025 13:39:52 +0000
Duration 00:35:02.03
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.3
Summary
2 Hosts
1377 Tasks
1365 Results
104 Plays
504 Files
0 Records

File: /home/zuul/src/opendev.org/openstack/ansible-role-uwsgi/tasks/uwsgi_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: Create uWSGI system group
  ansible.builtin.group:
    name: "{{ uwsgi_system_group_name }}"
    state: "present"
    system: "yes"

- name: Create uWSGI system user
  ansible.builtin.user:
    name: "{{ uwsgi_system_user_name }}"
    group: "{{ uwsgi_system_group_name }}"
    comment: "uwsgi user"
    shell: "/bin/false"
    system: "yes"
    createhome: "yes"
    home: "/var/lib/{{ uwsgi_system_user_name }}"

- name: Install distro packages
  ansible.builtin.package:
    name: "{{ uwsgi_package_list }}"
    state: "{{ uwsgi_package_state }}"
    update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
    cache_valid_time: "{{ (ansible_facts['distribution'] | lower == 'debian') | ternary(cache_timeout, omit) }}"
  register: install_packages
  until: install_packages is success
  retries: 5
  delay: 2
  notify:
    - Restart uwsgi services

- name: Install the python venv
  ansible.builtin.include_role:
    name: "python_venv_build"
  vars:
    venv_install_destination_path: "{{ uwsgi_bin | dirname }}"
    venv_pip_install_args: "{{ uwsgi_pip_install_args }}"
    venv_pip_packages: "{{ uwsgi_pip_packages }}"
    venv_build_distro_package_list: "{{ uwsgi_build_distro_package_list }}"
    venv_install_distro_package_list: "{{ uwsgi_source_package_list }}"
    venv_python_executable: "{{ uwsgi_python_executable }}"
    venv_facts_when_changed:
      - section: "uwsgi"
        option: "venv_tag"
        value: "{{ uwsgi_venv_tag }}"
  when: uwsgi_install_method == 'source'