From 5d6e6acb4bccc8ff95a8c2792af6db205a3a7b3d Mon Sep 17 00:00:00 2001 From: Hinrikus Wolf <hinrikus@fsmpi.rwth-aachen.de> Date: Sun, 1 Jul 2018 14:54:19 +0200 Subject: [PATCH] update documentation of uwsgi-python --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 77a7032..e05704b 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,50 @@ This role needs the patch from this [pull-request](https://github.com/ansible/an ### Variables +- `app_name`: the name of the app +- `app_user`: the user which runs the app---will be created +- `app_group`: the user's group which runs the app---will be created +- `app_home`: home directory of the user, usually `/var/www/<app_user>` +- `app_path`: the path where the program can be found, usually same as `app_home` +- `app_python_version`: the app's python version as number (2|3) +- `app_venv`: the absolut path to the virtualenv, which shall be used for the app +- `app_program`: the python executable, which lies in `app_path` +- `app_callable`: uwsgi variable <callable>, mostly app +- `app_command`: commandline arguments for the app +- `app_mountpoint`: the path in the URI, if the app shall be reachable under https://www.example.com/app, usually / + +- `app_db_name`: name of the db for the app, can be `""` if not any database is needed, usally same as `app_user` +- `app_db_type`: db type: (postgres|mysql|sqlite) + +- `app_additional_software`: list of software, which is additionally needed by the app e.g. LaTeX. If no additional software is needed it is `[]` + +- `app_deploy_key`: path to a ssh-key which is needed to get the software usaally, "{{ inventory_dir }}/files/deploy-keys/<app_name>" +- `app_git_url`: git url of the project +- `app_git_version`: git version usually `HEAD` + +- `app_config_file`: config file, usally `config.py` +- `app_secret_config`: it might be useful to have the cookie's key in seperate config (true|false) ### How to create a new app +Create the following files +* `uwsgi-python/vars/<app_name>.yml` +Define the variable in it from above and the variables, you need for you config file. We recommend to define them as defaults (and as documentation) +* `uwsgi-python/templates/apps/<app_name>.j2` + That's your config template. +* `uwsgi-python/tasks/apps/<app_name>.j2` + If you need some additional tasks, you can define them in this file + +If you have done this, you can create an instance of the app. Note, you have to define for every app an instance altough you only want to deploy it once. + ### How to create a new app's instance + +Create for every instance <inventory_dir>/vars/<instance_name>.yml a variable in which you can override the defaults from uwsgi-python/vars/<app_name>.yml + +Define in your host_vars/<host> the dictionary `webapps` + +webapps: + - instance: <instancen_name> + app: <app_name> + app_vars: "<instance_name>.yml" <-- path to variable file from above -- GitLab