Add salt states for gvapgsql

This commit is contained in:
Jan Dittberner 2017-08-20 12:55:04 +02:00
parent f08deff9b5
commit 87d2af1a8a
4 changed files with 48 additions and 0 deletions

View file

@ -0,0 +1,10 @@
include:
- gnuviechadmin
- gnuviechadmin.queues.common
- gnuviechadmin.queues.gvapgsql
gnuviechadmin:
component:
name: gvapgsql
amqp_user: pgsql
postgresql_admin_user: gvapgsql

View file

@ -0,0 +1,18 @@
include:
- gnuviechadmin.base
- gnuviechadmin.celery
gvapgsql-pgsql-user:
postgres_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin:pgsql_admin_user', 'gvapgsql') }}
- password: {{ salt['grains.get_or_set_hash']('gnuviechadmin.db_admin_password', 16) }}
- user: postgres
- superuser: True
- login: True
gvapgsql-packages:
pkg.installed:
- pkgs:
- libpq-dev
- require_in:
- pkg: gnuviechadmin-packages

View file

@ -0,0 +1,12 @@
#!/bin/sh
set -ex
. {{ home }}/gvasettings.sh
unset LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \
LC_IDENTIFICATION LC_ALL
cd {{ appdir }}
{{ virtualenv }}/bin/celery worker -A gvapgsql -Q pgsql --loglevel=INFO

View file

@ -0,0 +1,8 @@
#!/bin/sh
export GVAPGSQL_BROKER_URL='{{ broker_url }}'
export GVAPGSQL_RESULTS_REDIS_URL="redis://:{{ salt['pillar.get']('gnuviechadmin:redis_password') }}@{{ salt['pillar.get']('gnuviechadmin:redis_host') }}/0"
export GVAPGSQL_DBADMIN_HOST="{{ salt['pillar.get']('gnuviechadmin:pgsql_admin_host', 'localhost') }}"
export GVAPGSQL_DBADMIN_PORT="{{ salt['pillar.get']('gnuviechadmin:pgsql_admin_port', 5432) }}"
export GVAPGSQL_DBADMIN_USER="{{ salt['pillar.get']('gnuviechadmin:pgsql_admin_user', 'gvapgsql') }}"
export GVAPGSQL_DBADMIN_PASSWORD="{{ salt['grains.get_or_set_hash']('gnuviechadmin.db_admin_password', 16) }}"