parent
d9d4e412a7
commit
03b7fa343a
15 changed files with 83 additions and 10 deletions
@ -0,0 +1,10 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
# Plain TCP port |
||||||
|
rabbitmq_port: 5672 |
||||||
|
|
||||||
|
# Access to the plain port |
||||||
|
rabbitmq_src_ip: [] |
||||||
|
|
||||||
|
# Should the guest user available from anywhere ? If False, it'll only be accepted from loopback |
||||||
|
rabbitmq_guest_from_anywhere: False |
@ -0,0 +1,4 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- name: restart rabbitmq-server |
||||||
|
service: name=rabbitmq-server state=reloaded |
@ -0,0 +1,6 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- name: Deploy configuration |
||||||
|
template: src=rabbitmq.config.j2 dest=/etc/rabbitmq/rabbitmq.config |
||||||
|
notify: restart rabbitmq-server |
||||||
|
tags: rabbitmq |
@ -0,0 +1,8 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- name: Install RabbitMQ |
||||||
|
yum: |
||||||
|
name: |
||||||
|
- rabbitmq-server |
||||||
|
tags: rabbitmq |
||||||
|
|
@ -0,0 +1,8 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- name: Handle RabbitMQ Server port in the firewall |
||||||
|
iptables_raw: |
||||||
|
name: rabbitmq_port |
||||||
|
state: "{{ (rabbitmq_src_ip | length > 0) | ternary('present','absent') }}" |
||||||
|
rules: "-A INPUT -m state --state NEW -p tcp --dport {{ rabbitmq_port }} -s {{ rabbitmq_src_ip | join(',') }} -j ACCEPT" |
||||||
|
tags: firewall,rabbitmq |
@ -0,0 +1,7 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- include: install.yml |
||||||
|
- include: conf.yml |
||||||
|
- include: iptables.yml |
||||||
|
when: iptables_manage | default(True) |
||||||
|
- include: services.yml |
@ -0,0 +1,5 @@ |
|||||||
|
--- |
||||||
|
|
||||||
|
- name: Start and enable the service |
||||||
|
service: name=rabbitmq-server state=started enabled=True |
||||||
|
tags: rabbitmq |
@ -0,0 +1,12 @@ |
|||||||
|
%% {{ ansible_managed }} |
||||||
|
|
||||||
|
[ |
||||||
|
{rabbit, [ |
||||||
|
{tcp_listeners, [{{ rabbitmq_port }}]} |
||||||
|
,{reverse_dns_lookups, false} |
||||||
|
{% if rabbitmq_guest_from_anywhere %} |
||||||
|
,{loopback_users, []} |
||||||
|
{% endif %} |
||||||
|
] |
||||||
|
} |
||||||
|
]. |
Loading…
Reference in new issue