Setup redis and rabbitmq, fix gvaldap and gvaweb

This commit takes care of making rabbitmq and redis work on a messaging
server. The configuration of gvaldap and gvaweb has been adapted to make
both applications work with actual running rabbitmq and redis.
This commit is contained in:
Jan Dittberner 2020-03-04 15:02:58 +01:00
parent dd43bd4b31
commit a3dd83f4da
5 changed files with 765 additions and 143 deletions

View file

@ -9,7 +9,6 @@ gnuviechadmin:
adminemail: admin@gnuviech-server.de adminemail: admin@gnuviech-server.de
sitename: Gnuviech Customer Self Service sitename: Gnuviech Customer Self Service
domainname: localhost domainname: localhost
devinstance: True
minosuid: 10000 minosuid: 10000
minosgid: 10000 minosgid: 10000
osuserprefix: usr osuserprefix: usr

View file

@ -1,5 +1,8 @@
base: base:
{%- for role in ('database', 'redis', 'queues', 'gva', 'gvaldap', 'gvafile', 'gvamysql', 'gvapgsql', 'gvaweb') %} 'roles:redis-server':
- match: grain
- gnuviechadmin.redis
{%- for role in ('database', 'queues', 'gva', 'gvaldap', 'gvafile', 'gvamysql', 'gvapgsql', 'gvaweb') %}
'roles:gnuviechadmin.{{ role }}': 'roles:gnuviechadmin.{{ role }}':
- match: grain - match: grain
- gnuviechadmin.{{ role }} - gnuviechadmin.{{ role }}

View file

@ -168,7 +168,7 @@ update-{{ gvaappname }}-pip:
{% set update_git = salt['grains.get']('gnuviechadmin:update_git', True) %} {% set update_git = salt['grains.get']('gnuviechadmin:update_git', True) %}
{% set servicename = "{}-celery-worker".format(gvaappname) %} {% set servicename = "{}-celery-worker".format(gvaappname) %}
{% set amqp_user = salt['pillar.get']('gnuviechadmin:{}:amqpuser'.format(gvaappname)) -%} {% set amqp_user = salt['pillar.get']('gnuviechadmin:{}:amqp_user'.format(gvaappname)) -%}
{{ gvaapp_base(gvaappname, servicename ) }} {{ gvaapp_base(gvaappname, servicename ) }}
/etc/default/{{ gvaappname }}: /etc/default/{{ gvaappname }}:
file.managed: file.managed:
@ -180,7 +180,7 @@ update-{{ gvaappname }}-pip:
- context: - context:
virtualenv: {{ venv }} virtualenv: {{ venv }}
checkout: {{ checkout }} checkout: {{ checkout }}
broker_url: amqp://{{ amqp_user }}:{{ salt['pillar.get']('gnuviechadmin-queues:users:{}:password'.format(amqp_user)) }}@mq/{{ salt['pillar.get']('gnuviechadmin-queues:vhost') }} broker_url: amqp://{{ amqp_user }}:{{ salt['pillar.get']('gnuviechadmin:queues:users:{}:password'.format(amqp_user)) }}@{{ salt['pillar.get']('gnuviechadmin:amqp_host', 'mq') }}/{{ salt['pillar.get']('gnuviechadmin:queues:vhost') }}
result_url: redis://:{{ salt['pillar.get']('gnuviechadmin:redis_password') }}@{{ salt['pillar.get']('gnuviechadmin:redis_host') }}/0 result_url: redis://:{{ salt['pillar.get']('gnuviechadmin:redis_password') }}@{{ salt['pillar.get']('gnuviechadmin:redis_host') }}/0
- watch_in: - watch_in:
- service: {{ servicename }} - service: {{ servicename }}

View file

@ -16,7 +16,7 @@ gnuviechadmin-queue-user-{{ user }}:
- password: {{ salt['pillar.get']('gnuviechadmin:queues:users:%s:password' % user) }} - password: {{ salt['pillar.get']('gnuviechadmin:queues:users:%s:password' % user) }}
{% if salt['pillar.get']('gnuviechadmin:queues:users:%s:perms' % user) %} {% if salt['pillar.get']('gnuviechadmin:queues:users:%s:perms' % user) %}
- perms: - perms:
{% for vhost, perms in salt['pillar.get']('gnuviechadmin:queues:users:%s:perms' % user).iteritems() %} {% for vhost, perms in salt['pillar.get']('gnuviechadmin:queues:users:%s:perms' % user).items() %}
- {{ vhost }}: - {{ vhost }}:
- {{ perms[0] }} - {{ perms[0] }}
- {{ perms[1] }} - {{ perms[1] }}

File diff suppressed because it is too large Load diff