1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/examples/playbooks/rabbitmq.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2013-02-09 17:55:23 +01:00
---
- hosts: rabbitmq
sudo: true
vars:
rabbitmq_version: 3.0.2-1
tasks:
- name: ensure python-software-properties is installed
apt: pkg=python-software-properties state=installed
- name: add rabbitmq official apt repository
apt_repository: repo='deb http://www.rabbitmq.com/debian/ testing main' state=present
- name: install rabbitmq
apt: pkg=rabbitmq-server=$rabbitmq_version state=installed force=yes
- name: enable rabbitmq plugins
2013-03-01 14:30:50 +01:00
rabbitmq_plugin: names=rabbitmq_management,rabbitmq_tracing,rabbitmq_federation state=enabled
2013-02-09 17:55:23 +01:00
notify:
- restart rabbitmq
- name: add users
rabbitmq_user: user=$item password=changeme tags=administrator,$item vhost=/ configure_priv=.* write_priv=.* read_priv=.* state=present
2013-02-09 17:55:23 +01:00
with_items:
- user1
- user2
- name: remove default guest user
rabbitmq_user: user=guest state=absent
- name: ensure vhost /test is present
rabbitmq_vhost: name=/test state=present
2013-03-01 14:30:50 +01:00
- name: set federation local-username
rabbitmq_parameter: component=federation name=local-username value='"user1"' state=present
2013-02-09 17:55:23 +01:00
handlers:
- name: restart rabbitmq
service: name=rabbitmq-server state=restarted