Skip to content
Snippets Groups Projects
Commit 55ad923f authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

update documentation of uwsgi-python

parent f9bce82e
Branches
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment