store settings file in ~/.config/publik (#24505)
And allow additional user config in settings.d sub directories.
This commit is contained in:
parent
9b0f025786
commit
1d1e2b9dc7
|
@ -6,4 +6,3 @@
|
|||
- deploy-tenants
|
||||
vars:
|
||||
venv_bin: "{{venv}}/bin"
|
||||
venv_conf: "{{venv}}/conf"
|
||||
|
|
|
@ -2,6 +2,8 @@ compile_theme: true
|
|||
django_version: 1.11.18
|
||||
git_ssh: false
|
||||
clone_repo: true
|
||||
publik_conf: "/home/{{user}}/.config/publik"
|
||||
publik_settings: "{{publik_conf}}/settings"
|
||||
src_dir: "/home/{{user}}/src"
|
||||
ssl_certificate: "{{venv_certs}}/dev.publik.love-fullchain.pem"
|
||||
ssl_certificate_key: "{{venv_certs}}/dev.publik.love-privkey.pem"
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
themes_dir: "{{venv}}/themes"
|
||||
venv_bin: "{{venv}}/bin"
|
||||
venv_certs: "{{venv}}/certs"
|
||||
venv_conf: "{{venv}}/conf"
|
||||
venv_pip: "{{venv_bin}}/pip"
|
||||
venv_python: "{{venv_bin}}/python"
|
||||
venv_share: "{{venv}}/share"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
- name: set ansible server variables
|
||||
set_fact:
|
||||
app_settings: "{{venv_conf}}/{{db_name}}_settings.py"
|
||||
app_settings: "{{publik_settings}}/{{project_name}}/settings.py"
|
||||
app_settings_dir: "{{publik_settings}}/{{project_name}}"
|
||||
manage_app_bin: "{{venv_bin}}/{{project_name}}-manage"
|
||||
server_app_name: "{{project_name}}-server"
|
||||
|
||||
|
@ -11,14 +12,6 @@
|
|||
become: yes
|
||||
become_user: postgres
|
||||
|
||||
- name: "{{app_name}} - conf directory"
|
||||
file:
|
||||
path: "{{venv_conf}}"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
become: yes
|
||||
|
||||
- name: "{{app_name}} - /var/lib directory"
|
||||
file:
|
||||
path: "/var/lib/{{project_name}}"
|
||||
|
@ -54,6 +47,20 @@
|
|||
executable: /bin/bash
|
||||
become: yes
|
||||
|
||||
- name: "settings directory"
|
||||
file:
|
||||
path: "{{app_settings_dir}}"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
|
||||
- name: "settings.d directory"
|
||||
file:
|
||||
path: "{{app_settings_dir}}/settings.d"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
|
||||
- name: "{{app_name}} - settings file"
|
||||
template:
|
||||
src: "{{app_name}}-settings.j2"
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
# This file is sourced by "execfile" from hobo.settings
|
||||
# Don't modify this file, it will be overwritten if you update your
|
||||
# publik installation.
|
||||
# Custom settings should be declared in *.py file under the settings.d directory
|
||||
|
||||
import glob
|
||||
import os
|
||||
|
||||
{% block app_custom_before %}{% endblock %}
|
||||
|
@ -43,3 +47,6 @@ DEBUG = True
|
|||
|
||||
{% block app_custom_after %}{% endblock %}
|
||||
|
||||
for filename in sorted(
|
||||
glob.glob(os.path.join('{{app_settings_dir}}', 'settings.d', '*.py'))):
|
||||
execfile(filename)
|
||||
|
|
|
@ -27,7 +27,7 @@ MIDDLEWARE_CLASSES = (
|
|||
# }
|
||||
# }
|
||||
|
||||
WCS_LEGACY_CONFIG_FILE = '{{venv_conf}}/wcs.cfg'
|
||||
WCS_LEGACY_CONFIG_FILE = '{{app_settings_dir}}/wcs.cfg'
|
||||
WCS_EXTRA_MODULES = ['{{src_dir}}/auquotidien/auquotidien']
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -58,6 +58,16 @@
|
|||
path: "{{venv_share}}"
|
||||
state: directory
|
||||
|
||||
- name: "create conf directory"
|
||||
file:
|
||||
path: "{{publik_conf}}"
|
||||
state: directory
|
||||
|
||||
- name: "create settings directory"
|
||||
file:
|
||||
path: "{{publik_settings}}"
|
||||
state: directory
|
||||
|
||||
- name: create getlasso script
|
||||
template:
|
||||
src: getlasso.j2
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
set_fact:
|
||||
agent_dash_name: "hobo-agent"
|
||||
agent_dot_name: "hobo.agent"
|
||||
agent_settings: "{{venv_conf}}/hobo_agent_settings.py"
|
||||
agent_settings: "{{publik_settings}}/hobo-agent/settings.py"
|
||||
app_settings_dir: "{{publik_settings}}/hobo-agent"
|
||||
|
||||
- name: create hobo agent log directory
|
||||
file:
|
||||
|
@ -12,6 +13,13 @@
|
|||
group: "{{user}}"
|
||||
become: yes
|
||||
|
||||
- name: "settings directory"
|
||||
file:
|
||||
path: "{{app_settings_dir}}"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
|
||||
- name: hobo agent settings file
|
||||
template:
|
||||
src: hobo-agent-settings.j2
|
||||
|
|
|
@ -12,7 +12,7 @@ AGENT_HOST_PATTERNS = {
|
|||
{% filter upper %}{{appkey}}{% endfilter %}_MANAGE_COMMAND = "{{venv_bin}}/{{app['project_name']}}-manage"
|
||||
{% filter upper %}{{appkey}}{% endfilter %}_MANAGE_TRY_COMMAND = {% filter upper %}{{appkey}}{% endfilter %}_MANAGE_COMMAND
|
||||
{% else %}
|
||||
WCS_MANAGE_COMMAND = "{{venv_bin}}/wcsctl.py -f {{venv_conf}}/wcs.cfg"
|
||||
WCS_MANAGE_COMMAND = "{{venv_bin}}/wcsctl.py -f {{publik_settings}}/wcs/wcs.cfg"
|
||||
WCS_MANAGE_TRY_COMMAND = "{{venv_bin}}/wcsctl.py"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
|
|
@ -27,14 +27,24 @@
|
|||
path: "{{venv_share}}/{{app_name}}"
|
||||
state: directory
|
||||
|
||||
- name: "settings directory"
|
||||
file:
|
||||
path: "{{publik_settings}}/{{project_name}}"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
|
||||
- name: "settings.d directory"
|
||||
file:
|
||||
path: "{{publik_settings}}/{{project_name}}/settings.d"
|
||||
state: directory
|
||||
owner: "{{user}}"
|
||||
group: "{{user}}"
|
||||
|
||||
- name: wcs.cfg
|
||||
template:
|
||||
src: wcs.cfg
|
||||
dest: "{{venv_conf}}/wcs.cfg"
|
||||
|
||||
- name: wcs app setup
|
||||
import_role:
|
||||
name: app-setup
|
||||
dest: "{{publik_settings}}/{{app_name}}/wcs.cfg"
|
||||
|
||||
- name: wcs app setup
|
||||
import_role:
|
||||
|
|
Loading…
Reference in New Issue