---

- name: Add the RabbitMQ public GPG key to the apt repo
  apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
           state=present

- name: Add RabbitMQ to the sources list
  apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main'
                  update_cache={{ update_apt_cache }}
                  state=present

- name: Install RabbitMQ server
  apt: name={{ item }} update_cache={{ update_apt_cache }} force=yes state=installed
  with_items:
    - rabbitmq-server

- name: Enable the RabbitMQ Management Console
  rabbitmq_plugin: names=rabbitmq_management state=enabled
  notify: restart rabbitmq-server

- include: setup_vhosts.yml

- include: setup_users.yml

- name: Ensure that the RabbitMQ service is running
  service: name=rabbitmq-server state=started enabled=yes
---

- name: Add the RabbitMQ public GPG key to the apt repo
  apt_key: url=http://www.rabbitmq.com/rabbitmq-signing-key-public.asc
           state=present

- name: Add RabbitMQ to the sources list
  apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main'
                  update_cache={{ update_apt_cache }}
                  state=present

- name: Install RabbitMQ server
  apt: name={{ item }} update_cache={{ update_apt_cache }} force=yes state=installed
  with_items:
    - rabbitmq-server

- name: Enable the RabbitMQ Management Console
  rabbitmq_plugin: names=rabbitmq_management state=enabled
  notify: restart rabbitmq-server

- name: Make sure rabbitmq-server is enabled and running
  service:
    name: rabbitmq-server
    state: started
    enabled: true

- include: setup_vhosts.yml

- include: setup_users.yml

- name: Ensure that the RabbitMQ service is running
  service: name=rabbitmq-server state=started enabled=yes
Make sure RabbitMQ is running.
Make sure RabbitMQ is running.
