gvasalt/roots/gnuviechadmin/queues.sls
Jan Dittberner fedd0b95f2 enable rabbitmq management and add admin permissions
- allow database creation for gnuviechadmin user in local deployments to
  allow test runs
- set administrator tag for gnuviechadmin user in rabbitmq
- add all permissions on gnuviechadmin vhost to gnuviechadmin user
- enable rabbitmq management plugin
2016-01-31 21:08:32 +01:00

37 lines
1.3 KiB
Text

include:
- rabbitmq-server
gnuviechadmin-queues:
rabbitmq_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin-queues:owner:user') }}
- password: {{ salt['pillar.get']('gnuviechadmin-queues:owner:password') }}
- tags:
- administrator
- perms:
- {{ salt['pillar.get']('gnuviechadmin-queues:vhost') }}:
- '.*'
- '.*'
- '.*'
rabbitmq_vhost.present:
- name: {{ salt['pillar.get']('gnuviechadmin-queues:vhost') }}
- owner: {{ salt['pillar.get']('gnuviechadmin-queues:owner:user') }}
- require:
- rabbitmq_user: {{ salt['pillar.get']('gnuviechadmin-queues:owner:user') }}
{% for user in salt['pillar.get']('gnuviechadmin-queues:users') %}
gnuviechadmin-queue-user-{{ user }}:
rabbitmq_user.present:
- name: {{ user }}
- password: {{ salt['pillar.get']('gnuviechadmin-queues:users:%s:password' % user) }}
{% if salt['pillar.get']('gnuviechadmin-queues:users:%s:perms' % user) %}
- perms:
{% for vhost, perms in salt['pillar.get']('gnuviechadmin-queues:users:%s:perms' % user).iteritems() %}
- {{ vhost }}:
- {{ perms[0] }}
- {{ perms[1] }}
- {{ perms[2] }}
{% endfor %}
{% endif %}
- require:
- rabbitmq_vhost: {{ salt['pillar.get']('gnuviechadmin-queues:vhost') }}
{% endfor %}