diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-22 10:23:50 +0100 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-12-22 10:23:50 +0100 |
commit | 5f1f8b10f1efa57f9f07487b2b185ecf890eea18 (patch) | |
tree | fe9951d23658874f14042fea10b3b6f3ca2814f1 | |
parent | aa41a1991e352b6754c3cc5af3bcb15a7b8f5f94 (diff) |
ansible: Use unix socket instead of TCP ones.
* Refactor uwsgi config file into template.
* Add unix socket instead of TCP one.
* Fix nginx config to use unix socket.
Change-Id: Ibccba1078eb749f281ed8691aece9c4ce20ae5af
4 files changed, 11 insertions, 11 deletions
diff --git a/ansible/roles/configure-nginx/files/frontend-upstreams.conf b/ansible/roles/configure-nginx/files/frontend-upstreams.conf deleted file mode 100644 index 6eec848..0000000 --- a/ansible/roles/configure-nginx/files/frontend-upstreams.conf +++ /dev/null @@ -1,3 +0,0 @@ -upstream frontends { - server 127.0.0.1:5000; -} diff --git a/ansible/roles/configure-nginx/tasks/main.yml b/ansible/roles/configure-nginx/tasks/main.yml index 955981d..8219d05 100644 --- a/ansible/roles/configure-nginx/tasks/main.yml +++ b/ansible/roles/configure-nginx/tasks/main.yml @@ -68,11 +68,11 @@ - web-server - name: Install nginx upstream definitions - copy: src=frontend-upstreams.conf - dest=/etc/nginx/conf.d/frontend-upstreams.conf - mode=0644 - owner=root - group=root + template: src=frontend-upstreams.conf + dest=/etc/nginx/conf.d/frontend-upstreams.conf + mode=0644 + owner=root + group=root notify: - reload-nginx tags: diff --git a/ansible/roles/configure-nginx/templates/frontend-upstreams.conf b/ansible/roles/configure-nginx/templates/frontend-upstreams.conf new file mode 100644 index 0000000..e8b5fe0 --- /dev/null +++ b/ansible/roles/configure-nginx/templates/frontend-upstreams.conf @@ -0,0 +1,3 @@ +upstream frontends { + server unix:///var/run/uwsgi/app/kernelci-frontend/kernelci-frontend.socket; +} diff --git a/ansible/roles/configure-nginx/templates/kernelci-frontend.ini b/ansible/roles/configure-nginx/templates/kernelci-frontend.ini index e33ba10..fbb6759 100644 --- a/ansible/roles/configure-nginx/templates/kernelci-frontend.ini +++ b/ansible/roles/configure-nginx/templates/kernelci-frontend.ini @@ -1,6 +1,6 @@ [uwsgi] -socket = 127.0.0.1:5000 -threads = 2 +socket = /var/run/uwsgi/app/%n/%n.socket +threads = {{ uwsgi_threads }} uid = {{ web_user }} gid = {{ web_user }} master = true @@ -10,4 +10,4 @@ chdir = {{ install_base }}/{{ hostname }}/app module = server callable = app plugins = python - +optimize = 2 |