added ansible roles for swarming dynomite
This commit is contained in:
parent
198a14fc59
commit
cb033e7163
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- common
|
||||||
|
- dynomite
|
|
@ -1,7 +1,9 @@
|
||||||
---
|
---
|
||||||
|
target_path: /tmp/conductor_setup_test
|
||||||
|
|
||||||
conductor_network: conductor-network
|
conductor_network: conductor-network
|
||||||
|
|
||||||
dynomite_shards: 2
|
dynomite_shards: 3
|
||||||
dynomite_replicas: 3
|
dynomite_replicas: 3
|
||||||
|
|
||||||
elasticsearch_replicas: 1
|
elasticsearch_replicas: 1
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
- name: Create target directory
|
||||||
|
file:
|
||||||
|
path: "{{ target_path }}"
|
||||||
|
state: directory
|
|
@ -1,3 +1,18 @@
|
||||||
---
|
---
|
||||||
- name: Hello world dynomite
|
- name: Hello world dynomite
|
||||||
command: echo "Hello world"
|
command: echo "Hello world"
|
||||||
|
|
||||||
|
- name: Generate seedlist
|
||||||
|
template:
|
||||||
|
src: templates/seeds.list.j2
|
||||||
|
dest: "{{ target_path }}/seeds.list"
|
||||||
|
|
||||||
|
- name: Prepare seeds
|
||||||
|
debug: msg="{{item}}"
|
||||||
|
loop: "{{ lookup('file', '{{ target_path}}/seeds.list').splitlines() }}"
|
||||||
|
register: seeds
|
||||||
|
|
||||||
|
- name: Generate dynomite-swarm
|
||||||
|
template:
|
||||||
|
src: templates/dynomite-swarm.yaml.j2
|
||||||
|
dest: "{{ target_path }}/dynomite-swarm.yaml"
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{{ service }}:8101:{{ rack }}:{{ datacenter }}:{{ token }}
|
|
|
@ -1,9 +1,11 @@
|
||||||
dynomite1:
|
|
||||||
|
{% for seed in seeds.results %}
|
||||||
|
{{ seed.msg.split(':')[0] }}:
|
||||||
environment:
|
environment:
|
||||||
- DYNO_NODE={{ node_seed }}
|
- DYNO_NODE={{ seed.msg }}
|
||||||
image: nubisware/autodynomite:latest
|
image: nubisware/autodynomite:latest
|
||||||
networks:
|
networks:
|
||||||
{{ conductor-network }}:
|
{{ conductor_network }}:
|
||||||
logging:
|
logging:
|
||||||
driver: "journald"
|
driver: "journald"
|
||||||
deploy:
|
deploy:
|
||||||
|
@ -20,3 +22,4 @@
|
||||||
configs:
|
configs:
|
||||||
- source: seeds.list
|
- source: seeds.list
|
||||||
target: /dynomite/seeds.list
|
target: /dynomite/seeds.list
|
||||||
|
{%endfor%}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
version: '3.6'
|
version: '3.6'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
{{ dynomyte_services }}
|
{% include 'dynomite-service.yaml.j2' %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
{{ conductor_network }}:
|
{{ conductor_network }}:
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
seeds.list:
|
seeds.list:
|
||||||
file: {{ seeds_list_path }}
|
file: seeds.list
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{% for replica in range(1,dynomite_replicas+1) %}
|
||||||
|
{% set replicaloop = loop %}
|
||||||
|
{% for shard in range(1,dynomite_shards+1) %}
|
||||||
|
dynomite{{ (replicaloop.index - 1) * dynomite_shards + shard}}:8101:rack{{ replicaloop.index }}:datacenter1:{{ (shard - 1) * (4294967295 // dynomite_shards) }}
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}
|
Loading…
Reference in New Issue