]>
Commit | Line | Data |
---|---|---|
109c6b75 LSJ |
1 | Role Name |
2 | ========= | |
3 | ||
4 | Installs rabbitmq https://www.rabbitmq.com/ (Configurable...HA and Clustering ready) | |
5 | ||
3a55d2ab LSJ |
6 | Build Status |
7 | ------------ | |
8 | ||
9 | [![Build Status](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq.svg?branch=master)](https://travis-ci.org/mrlesmithjr/ansible-rabbitmq) | |
10 | ||
109c6b75 LSJ |
11 | Requirements |
12 | ------------ | |
13 | ||
14 | Ensure hostnames are resolvable prior to clustering...either update /etc/hosts or ensure DNS is working. | |
15 | ||
16 | Vagrant | |
17 | ------- | |
18 | ||
19 | Spin up a 3 node HA Cluster for testing... | |
20 | Install Ansible role on your host: | |
21 | ```` | |
22 | sudo ansible-galaxy install -r requirements.yml -f | |
23 | ```` | |
24 | Now spin up your environment... | |
25 | ```` | |
26 | vagrant up | |
27 | ```` | |
28 | When you are done testing, tear it all down... | |
29 | ```` | |
30 | ./cleanup.sh | |
31 | ```` | |
32 | ||
33 | Role Variables | |
34 | -------------- | |
35 | ||
36 | ```` | |
37 | --- | |
38 | # defaults file for ansible-rabbitmq | |
39 | rabbitmq_config_ha: false #defines if rabbitmq ha should be configured...define here or in group_vars/group | |
40 | rabbitmq_enable_clustering: false #defines if setting up a rabbitmq cluster...define here or in group_vars/group | |
41 | rabbitmq_erlang_cookie: 'LSKNKBELKPSTDBBCHETL' #define erlang cookie for cluster...define here or in group_vars/group | |
42 | rabbitmq_erlang_cookie_file: '/var/lib/rabbitmq/.erlang.cookie' | |
43 | rabbitmq_config: | |
44 | - queue_name: logstash | |
45 | durable: true | |
46 | exchange_name: logstash | |
47 | type: direct | |
48 | routing_key: logstash | |
49 | tags: 'ha-mode=all,ha-sync-mode=automatic' | |
50 | rabbitmq_debian_repo: 'deb http://www.rabbitmq.com/debian/ testing main' | |
51 | rabbitmq_debian_repo_key: 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc' | |
52 | rabbitmq_master: [] #defines the inventory host that should be considered master...define here or in group_vars/group | |
53 | rabbitmq_redhat_repo_key: 'https://www.rabbitmq.com/rabbitmq-signing-key-public.asc' | |
54 | rabbitmq_redhat_package: 'rabbitmq-server-{{ rabbitmq_redhat_version }}-1.noarch.rpm' | |
55 | rabbitmq_redhat_url: 'http://www.rabbitmq.com/releases/rabbitmq-server/v{{ rabbitmq_redhat_version }}' | |
56 | rabbitmq_redhat_version: '3.6.1' | |
57 | rabbitmq_users: #define admin user to create in order to login to WebUI | |
58 | - name: rabbitmqadmin | |
59 | password: rabbitmqadmin | |
60 | vhost: / | |
61 | configure_priv: '.*' | |
62 | read_priv: '.*' | |
63 | write_priv: '.*' | |
64 | tags: 'administrator' #define comma separated list of tags to assign to user....management,policymaker,monitoring,administrator...required for management plugin. https://www.rabbitmq.com/management.html | |
65 | ```` | |
66 | ||
67 | example... | |
68 | group_vars/rabbitmq-cluster-nodes | |
69 | ```` | |
70 | --- | |
71 | rabbitmq_enable_clustering: true | |
72 | rabbitmq_config_ha: false | |
73 | rabbitmq_master: ans-test-1 | |
74 | ```` | |
75 | ||
76 | Dependencies | |
77 | ------------ | |
78 | ||
79 | None | |
80 | ||
81 | Example Playbook | |
82 | ---------------- | |
83 | ||
84 | ```` | |
85 | --- | |
86 | - hosts: all | |
87 | become: true | |
88 | vars: | |
89 | - pri_domain_name: 'test.vagrant.local' | |
90 | roles: | |
91 | tasks: | |
92 | - name: updating /etc/hosts | |
93 | lineinfile: | |
94 | dest: /etc/hosts | |
95 | regexp: "^{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" | |
96 | line: "{{ hostvars[item].ansible_ssh_host }} {{ item }} {{ item }}.{{ pri_domain_name }}" | |
97 | state: present | |
3a55d2ab | 98 | with_items: "{{ groups['all'] }}" |
109c6b75 LSJ |
99 | |
100 | - hosts: all | |
101 | become: true | |
102 | vars: | |
103 | - rabbitmq_config_ha: true | |
104 | - rabbitmq_enable_clustering: true | |
105 | - pri_domain_name: 'test.vagrant.local' | |
106 | - rabbitmq_master: 'node0' | |
107 | roles: | |
108 | - role: ansible-rabbitmq | |
109 | tasks: | |
110 | ```` | |
111 | ||
112 | License | |
113 | ------- | |
114 | ||
115 | BSD | |
116 | ||
117 | Author Information | |
118 | ------------------ | |
119 | ||
120 | Larry Smith Jr. | |
121 | - @mrlesmithjr | |
122 | - http://everythingshouldbevirtual.com | |
123 | - mrlesmithjr [at] gmail.com |