gvasalt/roots/gnuviechadmin/queues.sls

31 lines
1.1 KiB
Text
Raw Normal View History

include:
- rabbitmq-server
gnuviechadmin-queues:
rabbitmq_user.present:
- name: {{ salt['pillar.get']('gnuviechadmin-queues:owner:user') }}
- password: {{ salt['pillar.get']('gnuviechadmin-queues:owner:password') }}
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 %}