From 7f2f209b6bf612cb69f5a6b5a8ef729de0a2be30 Mon Sep 17 00:00:00 2001 From: Hinrikus Wolf <hinrikus@fsmpi.rwth-aachen.de> Date: Thu, 28 Jun 2018 00:13:19 +0200 Subject: [PATCH] start clean-up --- uwsgi-python/meta/main.yml | 4 ---- uwsgi-python/tasks/app.yml | 9 ++------- uwsgi-python/tasks/mysql.yml | 6 +++--- uwsgi-python/templates/uwsgi.ini.j2 | 2 +- uwsgi-python/tmpfiles.conf | 2 -- uwsgi-python/vars/shorturl.yml | 7 +++++-- uwsgi-python/vars/template.yml | 28 ---------------------------- 7 files changed, 11 insertions(+), 47 deletions(-) delete mode 100644 uwsgi-python/meta/main.yml delete mode 100644 uwsgi-python/tmpfiles.conf delete mode 100644 uwsgi-python/vars/template.yml diff --git a/uwsgi-python/meta/main.yml b/uwsgi-python/meta/main.yml deleted file mode 100644 index 97abf43..0000000 --- a/uwsgi-python/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# file: uwsgi-python/meta/main.yml -dependencies: - - { role: uwsgi } diff --git a/uwsgi-python/tasks/app.yml b/uwsgi-python/tasks/app.yml index b8acf02..256b9ca 100644 --- a/uwsgi-python/tasks/app.yml +++ b/uwsgi-python/tasks/app.yml @@ -1,10 +1,5 @@ --- -# -#- debug: -# msg: "{{ app }}" -# -# - include_vars: "{{ item }}" with_items: @@ -25,7 +20,7 @@ - python-virtualenv - uwsgi-plugin-python - virtualenv - when: uwsgi_python == 2 + when: app_python_version == 2 tags: - uwsgi-app - "{{ app.app }}" @@ -41,7 +36,7 @@ - python3-virtualenv - uwsgi-plugin-python3 - virtualenv - when: uwsgi_python == 3 + when: app_python_version == 3 tags: - uwsgi-app - "{{ app.app }}" diff --git a/uwsgi-python/tasks/mysql.yml b/uwsgi-python/tasks/mysql.yml index 7dbaee9..7001771 100644 --- a/uwsgi-python/tasks/mysql.yml +++ b/uwsgi-python/tasks/mysql.yml @@ -15,7 +15,7 @@ - name: ensure the mysql database exists mysql_db: - name: "{{ app_name }}" + name: "{{ app_db_name }}" state: present login_user: root login_password: "{{ lookup('passwordstore', 'db/{{ansible_hostname}}-mysql create=true length=20') }}" @@ -27,11 +27,11 @@ - name: ensure the database user for mysql exists mysql_user: name: "{{ app_user }}" - password: "{{ lookup('passwordstore', 'db/{{ansible_hostname}}-mysql-{{uwsgi_user}} create=true length=20') }}" + password: "{{ lookup('passwordstore', 'db/{{ansible_hostname}}-mysql-{{app_user}} create=true length=20') }}" state: present login_user: root login_password: "{{lookup('passwordstore', 'db/{{ansible_hostname}}-mysql create=true length=20')}}" - priv: "{{ app_name }}.*:ALL" + priv: "{{ app_db_name }}.*:ALL" no_log: True tags: - uwsgi-python diff --git a/uwsgi-python/templates/uwsgi.ini.j2 b/uwsgi-python/templates/uwsgi.ini.j2 index 0bb1258..01d4119 100644 --- a/uwsgi-python/templates/uwsgi.ini.j2 +++ b/uwsgi-python/templates/uwsgi.ini.j2 @@ -1,5 +1,5 @@ [uwsgi] -uwsgi-socket = /run/uwsgi/{{app_name}}/{{app_name}}.sock +uwsgi-socket = /run/uwsgi/{{app.instance}}/{{app.instance}}.sock #http = localhost:5000 chmod-socket = 660 chown-socket = {{app_user}}:www-data diff --git a/uwsgi-python/tmpfiles.conf b/uwsgi-python/tmpfiles.conf deleted file mode 100644 index 50b2862..0000000 --- a/uwsgi-python/tmpfiles.conf +++ /dev/null @@ -1,2 +0,0 @@ -d /run/uwsgi 0755 root root - - -d /run/uwsgi/app 0755 root root - - diff --git a/uwsgi-python/vars/shorturl.yml b/uwsgi-python/vars/shorturl.yml index eee6f77..4ef6091 100644 --- a/uwsgi-python/vars/shorturl.yml +++ b/uwsgi-python/vars/shorturl.yml @@ -1,6 +1,6 @@ app_name: shorturl -app_user: shortlinks -app_group: shortlinks +app_user: shorturl +app_group: shorturl app_home: /var/www/shorturl app_path: /var/www/shorturl app_python_version: 3 @@ -10,8 +10,11 @@ app_callable: app app_command: "" app_mountpoint: / +app_db_name: shorturl app_db_type: postgres +app_additional_software: [] + app_deploy_key: "{{ inventory_dir }}/files/deploy-keys/shorturl" app_git_url: "git@git.fsmpi.rwth-aachen.de:infra/shorturl.git" app_git_version: HEAD diff --git a/uwsgi-python/vars/template.yml b/uwsgi-python/vars/template.yml deleted file mode 100644 index 9b8b8ce..0000000 --- a/uwsgi-python/vars/template.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: -user -group -home -path -python_version -venv -program = server.py -callable = app -command -mountpoint - -db_type - - - -uwsgi_options -uwsgi_harakiri -uwsgi_mules -uwsgi_enable_threads - -app_deploy_key -app_git_url -app_git_version - -config_file -secret_config = T/F - -- GitLab