OpenStack-Ansible uWSGI role

This role installs uwsgi service either inside it’s own virtualenv or with the system python and creates systemd services based on the provided definitions inside variable uwsgi_services.

To clone or view the source code for this repository, visit the role repository for uwsgi.

Default variables

uwsgi_system_user_name: uwsgi
uwsgi_system_group_name: uwsgi


# Set installation method. Valid options: source, distro
uwsgi_install_method: source

# Virtual env suffix to deploy into
uwsgi_venv_tag: "{{ venv_tag | default('untagged') }}"

uwsgi_pip_install_args: "{{ pip_install_options | default('') }}"
uwsgi_python_executable: "python2"

uwsgi_package_state: "latest"

# Define uwsgi_services for deployment of uwsgi. You should provide
# at least wsgi_path and uwsgi_port. wsgi_venv should be defined for
# services installed inside virtualenv.
# Example structure:
# uwsgi_services:
#   service:
#     service_name: service-api
#     wsgi_path: /openstack/venvs/api/bin/wsgi-api
#     wsgi_venv: /openstack/venvs/api
#     init_config_overrides: {}
#     uwsgi_uid: root
#     uwsgi_guid: root
#     uwsgi_overrides: {}
#     uwsgi_processes: [ansible_processor_vcpus | default(1), 1] | max * 2
#     uwsgi_threads: 1
#     uwsgi_bind_address: 0.0.0.0
#     uwsgi_port: 8080
uwsgi_services: {}

# Override can be used to apply config change to all uwsgi services
# instead of adjusting each service separately
uwsgi_ini_overrides: {}
uwsgi_init_config_overrides: {}

Example playbook

---
- name: Install uwsgi service
  hosts: localhost
  user: root
  roles:
    - role: "uwsgi"
  vars:
    uwsgi_services:
      api:
        wsgi_path: /openstack/venvs/api/bin/wsgi-api
        wsgi_venv: /openstack/venvs/api

Tags

This role supports two tags: uwsgi-install and uwsgi-config. The uwsgi-install tag can be used to install and upgrade. The uwsgi-config tag can be used to manage configuration and systemd services.