Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
95692ce9
Commit
95692ce9
authored
Jun 27, 2013
by
Feanil Patel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Playbook simplified by moving to rabbitmq 3.x instead of 2.x
parent
4b69defb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
42 deletions
+31
-42
playbooks/roles/rabbitmq/tasks/main.yml
+25
-40
playbooks/roles/rabbitmq/templates/rabbitmq.config.j2
+1
-1
playbooks/roles/rabbitmq/vars/main.yml
+5
-1
No files found.
playbooks/roles/rabbitmq/tasks/main.yml
View file @
95692ce9
---
#
Tasks related to setting up the rabbitmq machines
-
name
:
create a rabbitmq group
group
:
name=rabbitmq
#
It is recommended that this role be played with serial set to 1 because
# There is a bug with initializing multiple nodes in the HA cluster at once
# http://rabbitmq.1065348.n5.nabble.com/Rabbitmq-boot-failure-with-quot-tables-not-present-quot-td24494.html
-
name
:
create a rabbitmq user
user
:
name=rabbitmq group=rabbitmq
-
name
:
trust rabbit repository
apt_key
:
url={{rabbitmq_apt_key}} state=present
-
name
:
add rabbit repository
apt_repository
:
repo="{{rabbitmq_repository}}" state=present
-
name
:
install rabbitmq
apt
:
pkg={{rabbitmq_pkg}} state=present
-
name
:
stop rabbit cluster
service
:
name=rabbitmq-server state=stopped
# Defaulting to /var/lib/rabbitmq
-
name
:
crate cookie directory
-
name
:
cr
e
ate cookie directory
file
:
path={{rabbitmq_cookie_dir}} owner=rabbitmq group=rabbitmq mode=0755 state=directory
-
name
:
add rabbitmq erlang cookie
template
:
src=erlang.cookie.j2 dest=/home/rabbitmq/.erlang.cookie owner=rabbitmq group=rabbitmq mode=0400
-
name
:
add rabbitmq erlang cookie
template
:
src=erlang.cookie.j2 dest={{rabbitmq_cookie_location}} owner=rabbitmq group=rabbitmq mode=0400
register
:
erlang_cookie
# Defaulting to /etc/rabbitmq
-
name
:
create rabbitmq directory
-
name
:
create rabbitmq
config
directory
file
:
path={{rabbitmq_config_dir}} owner=root group=root mode=0755 state=directory
-
name
:
add rabbitmq environment configuration
...
...
@@ -25,45 +33,22 @@
-
name
:
add rabbitmq cluster configuration
template
:
src=rabbitmq.config.j2 dest={{rabbitmq_config_dir}}/rabbitmq.config owner=root group=root mode=0644
register
:
cluster_configuration
-
name
:
install rabbitmq
apt
:
pkg={{rabbitmq_pkg}} state=present
-
name
:
stop rabbit cluster
service
:
name="rabbitmq-server" state=stopped
# For some reason this needs to be run from the shell. Running it via the
# service module produces inconsintent results.
-
name
:
kill rabbit nodes
shell
:
executable=/bin/bash killall epmd beam
ignore_errors
:
True
tags
:
-
testit
# When rabbitmq starts up it creates a folder of metadata at '/var/lib/rabbitmq/mnesia'.
# This folder should be deleted before clustering is setup because it retains data
# that can conflict with the clustering information.
-
name
:
remove mnesia configuration
file
:
path={{rabbitmq_mnesia_folder}} state=absent
when
:
erlang_cookie.changed or cluster_configuration.changed
-
name
:
start rabbit nodes
shell
:
executable=/bin/bash service rabbitmq-server start
tags
:
-
testit
service
:
name=rabbitmq-server state=restarted
-
name
:
remove guest user
rabbitmq_user
:
user="guest" state=absent
ignore_errors
:
True
-
name
:
add admin users
rabbitmq_user
:
user='{{item.name}}' password='{{item.password}}' tags="administrator" state=present
with_items
:
rabbitmq_auth_config.admins
when
:
"
'admins'
in
rabbitmq_auth_config"
ignore_errors
:
True
# Verify user changes
-
name
:
get rabbit user list
command
:
rabbitmqctl list_users
register
:
rabbitmq_users
-
name
:
check all expected users exist.
command
:
rabbitmqctl list_user_permissions {{item.name}}
with_items
:
rabbitmq_auth_config.admins
-
name
:
make sure guest has been removed
fail
:
"
Guest
user
still
has
an
account."
when
:
"
'guest'
in
rabbitmq_users"
playbooks/roles/rabbitmq/templates/rabbitmq.config.j2
View file @
95692ce9
...
...
@@ -13,4 +13,4 @@
{%- endfor -%}
[{rabbit,
[{cluster_nodes,
['{{ hosts|join("\',\'") }}']
}]}].
[{cluster_nodes,
{['{{ hosts|join("\',\'") }}'], disc}
}]}].
playbooks/roles/rabbitmq/vars/main.yml
View file @
95692ce9
#Varibables for rabbitmq
---
rabbitmq_apt_key
:
"
http://www.rabbitmq.com/rabbitmq-signing-key-public.asc"
rabbitmq_repository
:
"
deb
http://www.rabbitmq.com/debian/
testing
main"
rabbitmq_pkg
:
"
rabbitmq-server"
rabbitmq_config_dir
:
"
/etc/rabbitmq"
rabbitmq_cookie_dir
:
"
/var/lib/rabbitmq"
rabbitmq_cookie_location
:
"
{{rabbitmq_cookie_dir}}/.erlang.cookie"
rabbitmq_mnesia_folder
:
"
{{rabbitmq_cookie_dir}}/mnesia"
rabbitmq_port
:
5672
rabbitmq_auth_config
:
erlang_cookie
:
"
YK+MSzXQskeVz6ap1P5zfg==
"
erlang_cookie
:
"
CHANGE
ME
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment