From 19bb89faaae91e870a98a826cb95c1947c10e523 Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 30 Jan 2023 17:29:24 +0000 Subject: [PATCH] Allow extra arguments to be passed to the uwsgi application through pyargv Related-Bug: 1987405 Change-Id: I89f7b27838647e4993cc2656d0fded9902e5f7c6 --- defaults/main.yml | 1 + tasks/uwsgi_post_install.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 65f65eb..b495dbc 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -54,6 +54,7 @@ uwsgi_env: "{{ _uwsgi_env }}" # uwsgi_tls: # crt: /path/to/crt # key: /path/to/key +# uwsgi_pyargv: "--foo=bar --config_file=/etc/foo/foo.conf" uwsgi_services: {} # Override can be used to apply config change to all uwsgi services diff --git a/tasks/uwsgi_post_install.yml b/tasks/uwsgi_post_install.yml index 1a5fef3..26377cf 100644 --- a/tasks/uwsgi_post_install.yml +++ b/tasks/uwsgi_post_install.yml @@ -46,7 +46,7 @@ - service_name: "{{ service_var.value.service_name | default(service_var.key) }}" enabled: yes state: started - execstarts: "{{ uwsgi_bin }}/uwsgi --autoload --ini /etc/uwsgi/{{ service_var.key }}.ini" + 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 }}"