76 lines
2.1 KiB
ReStructuredText
76 lines
2.1 KiB
ReStructuredText
Dev install of publik
|
|
=====================
|
|
|
|
Ansible playbook that install and setup a multitenant publik instance using sources.
|
|
|
|
|
|
Setup
|
|
=====
|
|
|
|
Install dependencies
|
|
++++++++++++++++++++
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
pip install --user -r requirements.txt
|
|
|
|
|
|
System requirements
|
|
+++++++++++++++++++
|
|
|
|
* postgresql server must be installed
|
|
* the system user used to run ansible must be a sudoer
|
|
* the system user used to run ansible must to be able to connect to the postgres server withpout authentication and must be authorized to create databases
|
|
* you need to have a valid SSL certificate ('ssl_certificate' and 'ssl_certificate_key' in configuration file)
|
|
|
|
|
|
Description
|
|
===========
|
|
|
|
The configuration file ('inventory' in ansible language) is inventory.yml, change it to suite your needs.
|
|
|
|
Important configuration variables :
|
|
|
|
* 'user' : must be the name of the system user used to run the playbook (DRY I know, but tell ansible about it)
|
|
* the 'ssl_certificate' used must be valid for the patterns delared in 'apps.host_pattern' and app.nginx_host_pattern
|
|
* 'apps.host_pattern' is used in the app server settings
|
|
* 'apps.nginx_host_pattern' is used in the nginx app settings
|
|
|
|
The playbook will first :
|
|
|
|
* install some system packages (see roles/base)
|
|
* create a virtualenv ('venv' variable)
|
|
|
|
Then for each 'app' registered in the 'apps' section of the configuration file, the following events will occur:
|
|
|
|
* git clone of the repository in 'src_dir' dir and install from sources
|
|
* create one configuration file for the app and one for its hobo agent (in 'venv_conf' directory)
|
|
* create app-manage, app-server and app-agent scripts in 'venv_bin' directory
|
|
* create app-server and app-agent supervisord configuration
|
|
* create /var/lib/app and /var/log/app directories
|
|
* create a nginx configuration for server-app
|
|
* create a database for the app and create its schema
|
|
|
|
|
|
Usage
|
|
=====
|
|
|
|
Install publik
|
|
|
|
.. code-block:: bash
|
|
|
|
ansible-playbook -i inventory.yml -K install.yml
|
|
|
|
|
|
Send publik to the cemetery
|
|
|
|
.. code-block:: bash
|
|
|
|
ansible-playbook -i inventory.yml -K clean.yml
|
|
|
|
Next
|
|
====
|
|
|
|
Help yourself with your DNS settings and create a tenant using cook
|