aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--README.md76
-rw-r--r--defaults/main.yml12
-rw-r--r--handlers/main.yml2
-rw-r--r--tasks/debian.yml6
-rw-r--r--tasks/main.yml3
-rw-r--r--tasks/rabbitmq_ha_config.yml16
6 files changed, 56 insertions, 59 deletions
diff --git a/README.md b/README.md
index b3b03ad..15f9cdf 100644
--- a/README.md
+++ b/README.md
@@ -1,65 +1,73 @@
1Role Name 1<!-- START doctoc generated TOC please keep comment here to allow auto update -->
2========= 2<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
3**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
3 4
4An [Ansible] role to install/configure [RabbitMQ] 5- [ansible-rabbitmq](#ansible-rabbitmq)
6 - [Build Status](#build-status)
7 - [Requirements](#requirements)
8 - [Vagrant](#vagrant)
9 - [Role Variables](#role-variables)
10 - [Dependencies](#dependencies)
11 - [Example Playbook](#example-playbook)
12 - [License](#license)
13 - [Author Information](#author-information)
5 14
6Build Status 15<!-- END doctoc generated TOC please keep comment here to allow auto update -->
7------------ 16
17# ansible-rabbitmq
18
19An [Ansible](https://www.ansible.com) role to install/configure [RabbitMQ](https://www.rabbitmq.com/)
20
21## Build Status
8 22
9[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq) 23[![Build Status](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq)
10 24
11Requirements 25## Requirements
12------------
13 26
14Ensure hostnames are resolvable prior to clustering...either update /etc/hosts 27Ensure hostnames are resolvable prior to clustering...either update /etc/hosts
15or ensure DNS is working. 28or ensure DNS is working.
16 29
17Vagrant 30## Vagrant
18-------
19 31
20Spin up a 3 node HA Cluster for testing... 32Spin up a 3 node HA Cluster for testing...
21Install Ansible role on your host: 33Install Ansible role on your host:
22``` 34
35```bash
23sudo ansible-galaxy install -r requirements.yml -f 36sudo ansible-galaxy install -r requirements.yml -f
24``` 37```
25Now spin up your environment... 38
26``` 39Now spin up your environment...
40
41```bash
27vagrant up 42vagrant up
28``` 43```
29When you are done testing, tear it all down... 44
30``` 45When you are done testing, tear it all down...
46
47```bash
31./cleanup.sh 48./cleanup.sh
32``` 49```
33 50
34Role Variables 51## Role Variables
35--------------
36 52
37[Role Defaults](./defaults/main.yml) 53[Role Defaults](./defaults/main.yml)
38 54
39Dependencies 55## Dependencies
40------------
41 56
42None 57None
43 58
44Example Playbook 59## Example Playbook
45----------------
46 60
47[Example Playbook](./playbook.yml) 61[Example Playbook](./playbook.yml)
48 62
49License 63## License
50-------
51 64
52BSD 65MIT
53 66
54Author Information 67## Author Information
55------------------
56 68
57Larry Smith Jr. 69Larry Smith Jr.
58- [@mrlesmithjr]
59- http://everythingshouldbevirtual.com
60- mrlesmithjr [at] gmail.com
61
62[@mrlesmithjr]: <https://www.twitter.com/mrlesmithjr>
63 70
64[Ansible]: <https://www.ansible.com> 71- [@mrlesmithjr](https://www.twitter.com/mrlesmithjr)
65[RabbitMQ]: <https://www.rabbitmq.com/> 72- [EverythingShouldBeVirtual](http://everythingshouldbevirtual.com)
73- [mrlesmithjr@gmail.com](mailto:mrlesmithjr@gmail.com)
diff --git a/defaults/main.yml b/defaults/main.yml
index a13fec0..4771a6b 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -15,15 +15,15 @@ rabbitmq_config: []
15rabbitmq_config_ha: false 15rabbitmq_config_ha: false
16 16
17rabbitmq_config_service: false 17rabbitmq_config_service: false
18rabbitmq_config_file: 'etc/rabbitmq/rabbitmq.config.j2' 18rabbitmq_config_file: etc/rabbitmq/rabbitmq.config.j2
19 19
20rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' 20# rabbitmq_debian_repo: deb http://www.rabbitmq.com/debian/ testing main
21#other repos 21#other repos
22#rabbitmq_debian_repo: deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main #bintray 22rabbitmq_debian_repo: "deb https://dl.bintray.com/rabbitmq/debian {{ ansible_distribution_release }} main #bintray"
23rabbitmq_debian_repo_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc' 23# rabbitmq_debian_repo_key: https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
24#rabbitmq_debian_repo_key: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq 24rabbitmq_debian_repo_key: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq
25rabbitmq_debian_erlang_from_rabbit: false 25rabbitmq_debian_erlang_from_rabbit: false
26#rabbitmq_debian_version: 3.7.9 # current version if not defined 26rabbitmq_debian_version: 3.7.9 # current version if not defined
27 27
28# Defines if setting up a rabbitmq cluster 28# Defines if setting up a rabbitmq cluster
29rabbitmq_enable_clustering: false 29rabbitmq_enable_clustering: false
diff --git a/handlers/main.yml b/handlers/main.yml
index 4fdafe5..c727c75 100644
--- a/handlers/main.yml
+++ b/handlers/main.yml
@@ -2,6 +2,6 @@
2# handlers file for ansible-rabbitmq 2# handlers file for ansible-rabbitmq
3- name: restart rabbitmq-server 3- name: restart rabbitmq-server
4 service: 4 service:
5 name: "rabbitmq-server" 5 name: rabbitmq-server
6 state: restarted 6 state: restarted
7 become: true 7 become: true
diff --git a/tasks/debian.yml b/tasks/debian.yml
index c98ff68..317932e 100644
--- a/tasks/debian.yml
+++ b/tasks/debian.yml
@@ -20,6 +20,8 @@
20 url: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq-erlang 20 url: https://bintray.com/user/downloadSubjectPublicKey?username=rabbitmq-erlang
21 state: present 21 state: present
22 become: true 22 become: true
23 register: result
24 until: result is successful
23 when: rabbitmq_debian_erlang_from_rabbit 25 when: rabbitmq_debian_erlang_from_rabbit
24 26
25- name: debian | add Rabbitmq erlang repo 27- name: debian | add Rabbitmq erlang repo
@@ -34,8 +36,10 @@
34 name: ['rabbitmq-server'] 36 name: ['rabbitmq-server']
35 state: present 37 state: present
36 become: true 38 become: true
39 register: result
40 until: result is successful
37 with_items: 41 with_items:
38 - rabbitmq-server{{ (rabbitmq_debian_version is defined) | ternary(['=',rabbitmq_debian_version] | join(''),'')}} 42 - rabbitmq-server{{ (rabbitmq_debian_version is defined) | ternary(['=',rabbitmq_debian_version] | join(''),'') }}
39 43
40- name: debian | enabling the RabbitMQ Management Console 44- name: debian | enabling the RabbitMQ Management Console
41 rabbitmq_plugin: 45 rabbitmq_plugin:
diff --git a/tasks/main.yml b/tasks/main.yml
index 8905c0b..3205473 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -15,7 +15,8 @@
15 when: rabbitmq_config_service 15 when: rabbitmq_config_service
16 16
17- name: checking to see if already clustered 17- name: checking to see if already clustered
18 stat: path=/etc/rabbitmq/clustered 18 stat:
19 path: /etc/rabbitmq/clustered
19 become: true 20 become: true
20 register: clustered 21 register: clustered
21 22
diff --git a/tasks/rabbitmq_ha_config.yml b/tasks/rabbitmq_ha_config.yml
index cc31333..cea301c 100644
--- a/tasks/rabbitmq_ha_config.yml
+++ b/tasks/rabbitmq_ha_config.yml
@@ -13,22 +13,6 @@
13 notify: restart rabbitmq-server 13 notify: restart rabbitmq-server
14 when: not rabbitmqadmin_check['stat']['exists'] 14 when: not rabbitmqadmin_check['stat']['exists']
15 15
16# - name: rabbitmq_ha_config | install rabbitMQ admin
17# shell: wget http://guest:guest@localhost:15672/cli/rabbitmqadmin
18# become: true
19# when: not rabbitmqadmin_check['stat']['exists']
20
21# - name: rabbitmq_ha_config | moving the rabbitMQ Admin
22# shell: mv rabbitmqadmin /usr/sbin
23# become: true
24# when: not rabbitmqadmin_check['stat']['exists']
25
26# - name: rabbitmq_ha_config | making executable rabbitMQ Admin
27# shell: chmod +x /usr/sbin/rabbitmqadmin
28# notify: restart rabbitmq-server
29# become: true
30# when: not rabbitmqadmin_check['stat']['exists']
31
32- name: rabbitmq_ha_config | creating queue(s) 16- name: rabbitmq_ha_config | creating queue(s)
33 command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }} 17 command: rabbitmqadmin declare queue name={{ item['queue_name'] }} durable={{ item['durable']|lower }} --vhost={{ item['vhost'] | default('/') }}
34 run_once: true 18 run_once: true