-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed generating single quote erlang config file #5
base: master
Are you sure you want to change the base?
Changes from all commits
0984b80
77b13ca
7cb32e4
f5b1b4b
042c2c9
7c7b00d
470b0e8
2536701
247295e
f3722cc
b8c3612
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
- name: rabbitmq restart | ||
service: name=rabbitmq-server state=restarted |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
- name: import erlang rpm key | ||
rpm_key: | ||
key: https://packages.erlang-solutions.com/rpm/erlang_solutions.asc | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
--- | ||
|
||
- name: add rabbitmq cluster hosts | ||
lineinfile: | ||
dest: /etc/hosts | ||
line: "{{ hostvars[item].rabbitmq_cluster_ip_address | default(hostvars[item].ansible_default_ipv4.address) }} {{ hostvars[item].ansible_hostname }}" | ||
with_items: "{{ ansible_play_hosts }}" | ||
|
||
- name: set erlang cookie | ||
template: | ||
src: erlang.cookie.j2 | ||
dest: "{{ rabbitmq_erlang_cookie_file }}" | ||
owner: rabbitmq | ||
group: rabbitmq | ||
mode: 0400 | ||
- name: set cluster name | ||
shell: "rabbitmqctl set_cluster_name {{ rabbitmq_cluster_name }}" | ||
|
||
- include: cluster.yml | ||
when: rabbitmq_cluster and rabbitmq_nodename != rabbitmq_cluster_master | ||
|
||
- name: start rabbitmq app | ||
shell: rabbitmqctl start_app |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,28 @@ | ||
--- | ||
|
||
- name: configure rabbitmq | ||
template: | ||
src: rabbitmq.config.j2 | ||
dest: /etc/rabbitmq/rabbitmq.config | ||
when: rabbitmq_config is defined | ||
|
||
- name: rabbitmq full stop | ||
include: node_fullstop.yml | ||
when: rabbitmq_erlang_cookie is defined | ||
|
||
- name: set erlang cookie | ||
template: | ||
src: erlang.cookie.j2 | ||
dest: "{{ rabbitmq_erlang_cookie_file }}" | ||
owner: rabbitmq | ||
group: rabbitmq | ||
mode: 0400 | ||
when: rabbitmq_erlang_cookie is defined | ||
|
||
- include: node_fullstart.yml | ||
|
||
- include: vhosts.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now with ansible 2.4 there should be improvements on these rabbitmq functions. Also it should support TLS that was a requirements for me with this role, so until ansible 2.3 there were issues with TLS and certificates. Now those should be fixed. Not sure. I suspended working on this one. |
||
|
||
- include: users.yml | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I noted in #6, this will fail when creating new users (at least it did for me). It would be good to only run this on the master node. |
||
|
||
- include: plugins.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
--- | ||
- include: rabbitmq.yml | ||
tags: | ||
- rabbitmq | ||
|
||
- name: include rabbitmq installation tasks | ||
include: "{{ ansible_os_family }}/install.yml" | ||
|
||
- include: configure.yml | ||
|
||
- include: configure-cluster.yml | ||
when: rabbitmq_cluster | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
|
||
- include: node_fullstop.yml | ||
- include: node_fullstart.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
|
||
- name: start rabbitmq server | ||
service: | ||
name: rabbitmq-server | ||
enabled: true | ||
state: started | ||
|
||
- name: start rabbitmq app | ||
shell: rabbitmqctl start_app |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
|
||
- name: start rabbitmq server | ||
service: | ||
name: rabbitmq-server | ||
state: started | ||
|
||
- name: stop rabbitmq app | ||
shell: rabbitmqctl stop_app | ||
|
||
- name: rabbitmq app reset | ||
shell: rabbitmqctl reset | ||
|
||
- name: stop rabbitmq server | ||
service: | ||
name: rabbitmq-server | ||
state: stopped |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
|
||
- name: start rabbitmq server | ||
service: | ||
name: rabbitmq-server | ||
enabled: true | ||
state: started | ||
|
||
- name: start rabbitmq app | ||
shell: rabbitmqctl start_app |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
- name: install rabbitmq plugins | ||
get_url: | ||
url: "{{ item.url }}" | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
- name: remove rabbitmq users | ||
rabbitmq_user: | ||
user: "{{ item }}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--- | ||
|
||
- name: remove rabbitmq virtual hosts | ||
rabbitmq_vhost: | ||
name: "{{ item }}" | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. It will make it easy to make the erlang_cookie setting optional. You only really want to set it once, during the initial setup and when doing maintenance updates it might be a good idea to leave it out.
This of course may introduce a problem when adding new nodes to the cluster. But I guess that this is a good enough trade-off in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it could be a problem adding new nodes. It should be more parametrized, but still for a new node you still can define that cookie from ansible CLI, so it should be possible.