From 358a989e645aa091daf71a299cb074abac180ec7 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Thu, 26 Aug 2021 11:09:00 +0200 Subject: [PATCH] Keystone: consolidate uWSGI config, drop non-existing plugin The Python 3 plugin no longer exists separately. Change-Id: Ie653db1078054fccbbfb60b88da024e4a46ee0b7 --- .../tasks/bootstrap.yml | 32 +++++++------------ .../templates/keystone-public.ini.j2 | 19 ----------- ...one-admin.ini.j2 => uwsgi-keystone.ini.j2} | 7 ++-- 3 files changed, 15 insertions(+), 43 deletions(-) delete mode 100644 playbooks/roles/bifrost-keystone-install/templates/keystone-public.ini.j2 rename playbooks/roles/bifrost-keystone-install/templates/{keystone-admin.ini.j2 => uwsgi-keystone.ini.j2} (62%) diff --git a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml index 6d905f2fd..48f10fb1a 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml @@ -248,33 +248,25 @@ group: "{{ nginx_user }}" # TODO(TheJulia): Split webserver user/group. mode: 0755 -- name: "Place keystone public uwsgi config" +- name: "Place keystone uWSGI config" template: - src: keystone-public.ini.j2 - dest: /etc/uwsgi/apps-available/keystone-public.ini + src: uwsgi-keystone.ini.j2 + dest: /etc/uwsgi/apps-available/keystone-{{ item }}.ini owner: "{{ nginx_user }}" group: "{{ nginx_user }}" # TODO(TheJulia): Split webserver user/group. mode: 0755 + loop: + - public + - admin -- name: "Place keystone admin uwsgi config" - template: - src: keystone-admin.ini.j2 - dest: /etc/uwsgi/apps-available/keystone-admin.ini - owner: "{{ nginx_user }}" - group: "{{ nginx_user }}" # TODO(TheJulia): Split webserver user/group. - mode: 0755 - -- name: "Enable keystone-public in uwsgi" +- name: "Enable keystone in uWSGI" file: - src: "/etc/uwsgi/apps-available/keystone-public.ini" - dest: "/etc/uwsgi/apps-enabled/keystone-public.ini" - state: link - -- name: "Enable keystone-admin in uwsgi" - file: - src: "/etc/uwsgi/apps-available/keystone-admin.ini" - dest: "/etc/uwsgi/apps-enabled/keystone-admin.ini" + src: "/etc/uwsgi/apps-available/keystone-{{ item }}.ini" + dest: "/etc/uwsgi/apps-enabled/keystone-{{ item }}.ini" state: link + loop: + - public + - admin - name: "Place nginx configuration for keystone" # TODO(TheJulia): Refactor this so we use sites-enabled, but bifrost's diff --git a/playbooks/roles/bifrost-keystone-install/templates/keystone-public.ini.j2 b/playbooks/roles/bifrost-keystone-install/templates/keystone-public.ini.j2 deleted file mode 100644 index 559aa6676..000000000 --- a/playbooks/roles/bifrost-keystone-install/templates/keystone-public.ini.j2 +++ /dev/null @@ -1,19 +0,0 @@ -# {{ ansible_managed }} -[uwsgi] -master = true -processes = 2 -threads = 2 -plugin = python3 -no-orphans = true -chmod-socket = 660 -virtualenv = {{ bifrost_venv_dir }} - -socket = /run/uwsgi/keystone-public.socket -pidfile = /run/uwsgi/keystone-public.pid - -name = keystone -uid = keystone -gid = {{ nginx_user }} - -chdir = /var/www/keystone/ -wsgi-file = /var/www/keystone/public diff --git a/playbooks/roles/bifrost-keystone-install/templates/keystone-admin.ini.j2 b/playbooks/roles/bifrost-keystone-install/templates/uwsgi-keystone.ini.j2 similarity index 62% rename from playbooks/roles/bifrost-keystone-install/templates/keystone-admin.ini.j2 rename to playbooks/roles/bifrost-keystone-install/templates/uwsgi-keystone.ini.j2 index 65832636d..119941518 100644 --- a/playbooks/roles/bifrost-keystone-install/templates/keystone-admin.ini.j2 +++ b/playbooks/roles/bifrost-keystone-install/templates/uwsgi-keystone.ini.j2 @@ -3,17 +3,16 @@ master = true processes = 2 threads = 2 -plugin = python3 no-orphans = true chmod-socket = 660 virtualenv = {{ bifrost_venv_dir }} -socket = /run/uwsgi/keystone-admin.socket -pidfile = /run/uwsgi/keystone-admin.pid +socket = /run/uwsgi/keystone-{{ item }}.socket +pidfile = /run/uwsgi/keystone-{{ item }}.pid name = keystone uid = keystone gid = {{ nginx_user }} chdir = /var/www/keystone/ -wsgi-file = /var/www/keystone/admin +wsgi-file = /var/www/keystone/{{ item }}