install and deploy multi-tenant fargo (#22905)

This commit is contained in:
Thomas NOËL 2018-03-29 16:20:11 +02:00
parent 45460fb1fe
commit 65bd6387cb
7 changed files with 60 additions and 0 deletions

View File

@ -8,6 +8,7 @@
- combo
- wcs
- passerelle
- fargo
- hobo-agent
- end
vars:

View File

@ -41,6 +41,12 @@ local:
nginx_host_pattern: '~^(.*)\-passerelle\.local\.publik$'
project_name: passerelle
server_port: 8024
fargo:
db_name: fargo
host_pattern: "*-fargo.local.publik"
nginx_host_pattern: '~^(.*)\-fargo\.local\.publik$'
project_name: fargo
server_port: 8036
wcs:
db_name: wcs
host_pattern: "*-wcs.local.publik"
@ -54,3 +60,4 @@ local:
dev-hobo: "dev-hobo.local.publik"
demarches-wcs: "demarches-wcs.local.publik"
dev-passerelle: "dev-passerelle.local.publik"
dev-fargo: "dev-fargo.local.publik"

View File

@ -0,0 +1,11 @@
{% extends "app-settings-base.j2" %}
{% block app_custom_before %}
# SAML2 authentication
INSTALLED_APPS += ('mellon',)
{% endblock %}
{% block app_custom_after %}
# disable django-mellon autologin
MELLON_OPENED_SESSION_COOKIE_NAME = None
{% endblock %}

View File

@ -38,6 +38,10 @@
"template_name": "{{wcs_skeleton_filename}}",
"title": "Passerelle"
}},
{"create-fargo": {
"url": "https://{{tenants_conf['dev-fargo']}}/",
"title": "Porte-documents"
}},
{"set-theme": {
"theme": "publik"
}}

View File

@ -0,0 +1,14 @@
- name: source install fargo
import_tasks: install_source.yml
vars:
repo: "fargo"
repo_dir: "{{ src_dir }}/fargo"
- name: fargo app setup
import_role:
name: app-setup
- name: fargo nginx setup
import_role:
name: nginx-setup

11
roles/fargo/vars/main.yml Normal file
View File

@ -0,0 +1,11 @@
app_name: fargo
compile_scss: false
compile_translations: true
migrate_schemas: true
db_name: "{{apps['fargo']['db_name']}}"
manage_cmd: "{{venv_python}} {{src_dir}}/fargo/manage.py"
nginx_host_pattern: "{{apps['fargo']['nginx_host_pattern']}}"
nginx_template_name: "fargo-nginx-server.j2"
project_name: "{{apps['fargo']['project_name']}}"
server_port: "{{apps['fargo']['server_port']}}"
settings_env_var: FARGO_SETTINGS_FILE

View File

@ -0,0 +1,12 @@
{% extends "base-nginx-server.j2" %}
{% block middle %}
location ~ ^/static/(.+)$ {
root /;
try_files /var/lib/{{project_name}}/tenants/$host/static/$1
/var/lib/{{project_name}}/tenants/$host/theme/static/$1
/var/lib/{{project_name}}/collectstatic/$1
=404;
add_header Access-Control-Allow-Origin *;
}
{% endblock %}