2015-10-04 20:18:44 +02:00
|
|
|
include:
|
|
|
|
- rabbitmq-server
|
|
|
|
|
|
|
|
gnuviechadmin-queues:
|
|
|
|
rabbitmq_user.present:
|
|
|
|
- name: {{ salt['pillar.get']('gnuviechadmin-queues:owner:user') }}
|
|
|
|
- password: {{ salt['pillar.get']('gnuviechadmin-queues:owner:password') }}
|
2015-10-11 15:28:23 +02:00
|
|
|
- tags:
|
|
|
|
- administrator
|
|
|
|
- perms:
|
|
|
|
- {{ salt['pillar.get']('gnuviechadmin-queues:vhost') }}:
|
|
|
|
- '.*'
|
|
|
|
- '.*'
|
|
|
|
- '.*'
|
2015-10-04 20:18:44 +02:00
|
|
|
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 %}
|