Use absolute path for uwsgi_params include

Nginx config verification that is performed by ansible [1] is made
in tmp "on fly" which fails because of the relative import.

We also move task that replaces ports for nginx.conf to the end
so that config validation was accomplished after all configurations
are applied.

[1] https://opendev.org/openstack/openstack-ansible-os_keystone/src/branch/master/tasks/keystone_nginx.yml#L44

Change-Id: Ic52fc7dbdb0324ab8f4b71d25398f23a05df05d7
This commit is contained in:
Dmitriy Rabotyagov 2021-02-16 11:18:08 +02:00
parent 20cf64fa0c
commit e377209297
2 changed files with 16 additions and 13 deletions

View File

@ -36,18 +36,6 @@
- Manage LB - Manage LB
- Restart web server - Restart web server
- name: Ensure nginx does not listen on 80 port
replace:
path: /etc/nginx/nginx.conf
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
validate: nginx -t -c %s
with_items:
- regexp: '(\s+listen\s+)[\[,\],:]+80'
replace: '\1 [::1]:8008'
- regexp: '(\s+listen\s+)80'
replace: '\1 127.0.0.1:8008'
- name: Ensure configuration directories exist - name: Ensure configuration directories exist
file: file:
path: "{{ item }}" path: "{{ item }}"
@ -104,3 +92,18 @@
notify: notify:
- Manage LB - Manage LB
- Restart web server - Restart web server
- name: Ensure nginx does not listen on 80 port
replace:
path: /etc/nginx/nginx.conf
regexp: "{{ item.regexp }}"
replace: "{{ item.replace }}"
validate: nginx -t -c %s
with_items:
- regexp: '(\s+listen\s+)[\[,\],:]+80'
replace: '\1 [::1]:8008'
- regexp: '(\s+listen\s+)80'
replace: '\1 127.0.0.1:8008'
notify:
- Manage LB
- Restart web server

View File

@ -47,7 +47,7 @@ server {
} }
location @yourapplication { location @yourapplication {
include uwsgi_params; include /etc/nginx/uwsgi_params;
uwsgi_pass 127.0.0.1:{{ keystone_uwsgi_ports[item]['socket'] }}; uwsgi_pass 127.0.0.1:{{ keystone_uwsgi_ports[item]['socket'] }};
uwsgi_param SCRIPT_NAME ''; uwsgi_param SCRIPT_NAME '';
{% for header in keystone_extra_headers %} {% for header in keystone_extra_headers %}