Rabbitmq resources

This commit is contained in:
Łukasz Oleś 2015-05-29 09:08:11 +00:00
parent fa792c81d8
commit cc1f644eee
15 changed files with 198 additions and 2 deletions

View File

@ -5,10 +5,10 @@ version: 1.0.0
input:
config_dir:
schema: str!
value:
value: /etc/solar/keystone
admin_token:
schema: str!
value: /etc/solar/keystone
value:
db_password:
schema: str!
value: password

View File

@ -0,0 +1,4 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- file: path={{config_dir}} state=absent

View File

@ -0,0 +1,8 @@
- hosts: [{{ ip }}]
sudo: yes
vars:
admin_user: {{admin_user}}
admin_password: {{admin_password}}
tasks:
- file: path={{config_dir}} state=directory
- template: src={{resource_dir}}/templates/rabbitmq.conf dest={{config_dir}}/rabbitmq.conf

View File

@ -0,0 +1,22 @@
id: rabbitmq_config
handler: ansible
version: 1.0.0
input:
config_dir:
schema: str!
value:
admin_name:
schema: str!
value:
admin_password:
schema: str!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:

View File

@ -0,0 +1,30 @@
[
{rabbit, [
{cluster_partition_handling, autoheal},
{default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
{default_vhost, <<"/">>},
{log_levels, [connection,info,error]},
{tcp_listen_options, [
binary,
{packet, raw},
{reuseaddr, true},
{backlog, 128},
{nodelay, true},
{exit_on_close, false},
{keepalive, true}
]},
{default_user, <<"{{default_user}}">>},
{default_pass, <<"{{default_password}}">>}
]},
{kernel, [
{inet_default_connect_options, [{nodelay,true}]},
{inet_dist_listen_max, 41055},
{inet_dist_listen_min, 41055}
]}
,
{rabbitmq_management, [
{listener, [
{port, 15672}
]}
]}
].

View File

@ -0,0 +1,9 @@
# TODO
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: rabbitmq container
docker:
name: {{ container_name }}
image: {{ image }}
state: absent

View File

@ -0,0 +1,17 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- name: rabbitmq container
docker:
command: /bin/bash -c rabbitmq-server
name: {{ container_name }}
image: {{ image }}
state: running
expose:
- 5672
- 15672
ports:
- {{ port }}:5672
- {{ management_port }}:15672
env:
RABBITMQ_NODENAME: {{container_name}}

View File

@ -0,0 +1,25 @@
id: rabbitmq_service
handler: ansible
version: 1.0.0
input:
image:
schema: str!
value: rabbitmq:3-management
container_name:
schema: str!
value:
management_port:
schema: str!
value:
port:
schema: str!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:

View File

@ -0,0 +1 @@
{{erlang_cookie}}

View File

@ -0,0 +1,8 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- new_rabbitmq_user: user={{user_name}}
vhost={{vhost_name}}
state=absent
node={{container_name}}
rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl"

View File

@ -0,0 +1,12 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- new_rabbitmq_user: user={{user_name}}
password={{password}}
vhost={{vhost_name}}
configure_priv=.*
read_priv=.*
write_priv=.*
state=present
node={{container_name}}
rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl"

View File

@ -0,0 +1,25 @@
id: keystone_user
handler: ansible
version: 1.0.0
input:
container_name:
schema: str!
value:
user_name:
schema: str!
value:
password:
schema: str!
value:
vhost_name:
schema: str!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:

View File

@ -0,0 +1,7 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- new_rabbitmq_vhost: name={{vhost_name}}
state=absent
rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl"
node={{container_name}}

View File

@ -0,0 +1,7 @@
- hosts: [{{ ip }}]
sudo: yes
tasks:
- new_rabbitmq_vhost: name={{vhost_name}}
node={{container_name}}
state=present
rabbitmqctl="docker exec -it {{container_name}} rabbitmqctl"

View File

@ -0,0 +1,21 @@
id: rabbitmq_vhost
handler: ansible
version: 1.0.0
input:
container_name:
schema: str!
value:
vhost_name:
schema: str!
value:
ip:
schema: str!
value:
ssh_key:
schema: str!
value:
ssh_user:
schema: str!
value:
tags: [resource/rabbitmq]