Make gvafile deployment work
This commit refactors to gnuviechadmin.base state by moving the Django specific parts into gnuviechadmin.django that is now used by gnuviechadmin.gvaldap and gnuviechadmin.webinterface. The script templates gnuviechadmin/gvafile/run_celery.sh and gnuviechadmin/gvafile/settings.sh have been added.
This commit is contained in:
parent
1bb9742751
commit
7ec29b9ce2
6 changed files with 38 additions and 21 deletions
|
@ -49,27 +49,6 @@ gnuviechadmin-requires:
|
||||||
- pkg: gnuviechadmin-packages
|
- pkg: gnuviechadmin-packages
|
||||||
- unless: test -e {{ venv }}/lastinstall && test {{ checkout }}/requirements/local.txt -ot {{ venv }}/lastinstall && test {{ checkout }}/requirements/base.txt -ot {{ venv }}/lastinstall
|
- unless: test -e {{ venv }}/lastinstall && test {{ checkout }}/requirements/local.txt -ot {{ venv }}/lastinstall && test {{ checkout }}/requirements/base.txt -ot {{ venv }}/lastinstall
|
||||||
|
|
||||||
gnuviechadmin-dbschema:
|
|
||||||
cmd.wait:
|
|
||||||
- name: . {{ home }}/gvasettings.sh ; unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME ; {{ venv }}/bin/python manage.py migrate --noinput
|
|
||||||
- user: vagrant
|
|
||||||
- group: vagrant
|
|
||||||
- cwd: {{ appdir }}
|
|
||||||
- watch:
|
|
||||||
- cmd: gnuviechadmin-requires
|
|
||||||
- file: {{ home }}/gvasettings.sh
|
|
||||||
|
|
||||||
gnuviechadmin-locale-data-compile:
|
|
||||||
cmd.wait:
|
|
||||||
- name: . {{ home }}/gvasettings.sh ; {{ venv }}/bin/python {{ appdir }}/manage.py compilemessages
|
|
||||||
- user: vagrant
|
|
||||||
- group: vagrant
|
|
||||||
- cwd: {{ appdir }}
|
|
||||||
- require:
|
|
||||||
- pkg: gnuviechadmin-packages
|
|
||||||
- file: {{ home }}/gvasettings.sh
|
|
||||||
- cmd: gnuviechadmin-venv
|
|
||||||
|
|
||||||
/home/vagrant/.bash_functions:
|
/home/vagrant/.bash_functions:
|
||||||
file.managed:
|
file.managed:
|
||||||
- user: vagrant
|
- user: vagrant
|
||||||
|
|
22
states/gnuviechadmin/django.sls
Normal file
22
states/gnuviechadmin/django.sls
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{% from 'gnuviechadmin/vars.sls' import home, appdir, venv %}
|
||||||
|
|
||||||
|
gnuviechadmin-dbschema:
|
||||||
|
cmd.wait:
|
||||||
|
- name: . {{ home }}/gvasettings.sh ; unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME ; {{ venv }}/bin/python manage.py migrate --noinput
|
||||||
|
- user: vagrant
|
||||||
|
- group: vagrant
|
||||||
|
- cwd: {{ appdir }}
|
||||||
|
- watch:
|
||||||
|
- cmd: gnuviechadmin-requires
|
||||||
|
- file: {{ home }}/gvasettings.sh
|
||||||
|
|
||||||
|
gnuviechadmin-locale-data-compile:
|
||||||
|
cmd.wait:
|
||||||
|
- name: . {{ home }}/gvasettings.sh ; {{ venv }}/bin/python {{ appdir }}/manage.py compilemessages
|
||||||
|
- user: vagrant
|
||||||
|
- group: vagrant
|
||||||
|
- cwd: {{ appdir }}
|
||||||
|
- require:
|
||||||
|
- pkg: gnuviechadmin-packages
|
||||||
|
- file: {{ home }}/gvasettings.sh
|
||||||
|
- cmd: gnuviechadmin-venv
|
7
states/gnuviechadmin/gvafile/run_celery.sh
Normal file
7
states/gnuviechadmin/gvafile/run_celery.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
. {{ home }}/gvasettings.sh
|
||||||
|
cd {{ appdir }}
|
||||||
|
{{ virtualenv }}/bin/celery worker -A gvafile -Q file --loglevel=INFO
|
7
states/gnuviechadmin/gvafile/settings.sh
Normal file
7
states/gnuviechadmin/gvafile/settings.sh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
export GVAFILE_BROKER_URL='{{ broker_url }}'
|
||||||
|
export GVAFILE_RESULTS_REDIS_URL="redis://:{{ salt['pillar.get']('gnuviechadmin:redis_password') }}@{{ salt['pillar.get']('gnuviechadmin:redis_host') }}/0"
|
||||||
|
export GVAFILE_SFTP_DIRECTORY="{{ salt['pillar.get']('gnuviechadmin:sftp_directory') }}"
|
||||||
|
export GVAFILE_MAIL_DIRECTORY="{{ salt['pillar.get']('gnuviechadmin:mail_directory') }}"
|
||||||
|
export GVAFILE_SFTP_AUTHKEYS_DIRECTORY="{{ salt['pillar.get']('gnuviechadmin:sftp_authkeys_directory') }}"
|
|
@ -1,5 +1,6 @@
|
||||||
include:
|
include:
|
||||||
- gnuviechadmin.base
|
- gnuviechadmin.base
|
||||||
|
- gnuviechadmin.django
|
||||||
- gnuviechadmin.celery
|
- gnuviechadmin.celery
|
||||||
|
|
||||||
gvaldap-packages:
|
gvaldap-packages:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
include:
|
include:
|
||||||
- gnuviechadmin.base
|
- gnuviechadmin.base
|
||||||
|
- gnuviechadmin.django
|
||||||
- webserver
|
- webserver
|
||||||
|
|
||||||
libpq-dev:
|
libpq-dev:
|
||||||
|
|
Loading…
Reference in a new issue