Idea 1
This commit is contained in:
parent
27d5c142f9
commit
1e8f380338
4
resources/riak_commit/actions/commit.yml
Normal file
4
resources/riak_commit/actions/commit.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- hosts: [{{ip}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: riak-admin cluster commit
|
18
resources/riak_commit/meta.yaml
Normal file
18
resources/riak_commit/meta.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
id: riak_commit
|
||||
handler: ansible
|
||||
version: 1.0.0
|
||||
actions:
|
||||
commit: actions/commit.yml
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
riak_names:
|
||||
schema: [{riak_name: str}]
|
||||
value: []
|
4
resources/riak_join_single/actions/join.yml
Normal file
4
resources/riak_join_single/actions/join.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- hosts: [{{ip}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: riak-admin cluster join {{join_to}}
|
18
resources/riak_join_single/meta.yaml
Normal file
18
resources/riak_join_single/meta.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
id: riak_join_single
|
||||
handler: ansible
|
||||
version: 1.0.0
|
||||
actions:
|
||||
join: actions/join.yml
|
||||
input:
|
||||
join_to:
|
||||
schema: str!
|
||||
value:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
4
resources/riak_node/actions/commit.yml
Normal file
4
resources/riak_node/actions/commit.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- hosts: [{{ip}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: riak-admin cluster commit
|
6
resources/riak_node/actions/remove.yml
Normal file
6
resources/riak_node/actions/remove.yml
Normal file
@ -0,0 +1,6 @@
|
||||
- hosts: [{{ip}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- apt:
|
||||
name: riak
|
||||
state: absent
|
25
resources/riak_node/actions/run.yml
Normal file
25
resources/riak_node/actions/run.yml
Normal file
@ -0,0 +1,25 @@
|
||||
- hosts: [{{ip}}]
|
||||
sudo: yes
|
||||
tasks:
|
||||
- shell: curl -s https://packagecloud.io/install/repositories/basho/riak/script.deb.sh | sudo bash
|
||||
- apt:
|
||||
name: riak
|
||||
state: present
|
||||
# - shell: sed -ie "s/127.0.0.1/{{ip}}/g" /etc/riak/riak.conf
|
||||
- service:
|
||||
name: riak
|
||||
state: stopped
|
||||
- replace:
|
||||
dest: /etc/riak/riak.conf
|
||||
regexp: '127.0.0.1'
|
||||
replace: '0.0.0.0'
|
||||
- replace:
|
||||
dest: /etc/riak/riak.conf
|
||||
regexp: '^nodename = .*\n'
|
||||
replace: 'nodename = {{riak_name}}\n\n'
|
||||
# TODO: should use name/hostname instead of ip
|
||||
- shell: rm -fr /var/lib/riak/kv_vnode/*
|
||||
- shell: rm -fr /var/lib/riak/ring/*
|
||||
- service:
|
||||
name: riak
|
||||
state: reloaded
|
17
resources/riak_node/meta.yaml
Normal file
17
resources/riak_node/meta.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
id: riak_node
|
||||
handler: ansible
|
||||
version: 1.0.0
|
||||
actions:
|
||||
input:
|
||||
ip:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_key:
|
||||
schema: str!
|
||||
value:
|
||||
ssh_user:
|
||||
schema: str!
|
||||
value:
|
||||
riak_name:
|
||||
schema: str!
|
||||
value:
|
20
templates/riak_nodes.yml
Normal file
20
templates/riak_nodes.yml
Normal file
@ -0,0 +1,20 @@
|
||||
id: simple_riak_cluster
|
||||
resources:
|
||||
- id: node1
|
||||
from: resources/ro_node
|
||||
values:
|
||||
ip: '10.0.0.3'
|
||||
ssh_key: '/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key'
|
||||
ssh_user: 'vagrant'
|
||||
- id: node2
|
||||
from: resources/ro_node
|
||||
values:
|
||||
ip: '10.0.0.4'
|
||||
ssh_key: '/vagrant/.vagrant/machines/solar-dev2/virtualbox/private_key'
|
||||
ssh_user: 'vagrant'
|
||||
- id: node3
|
||||
from: resources/ro_node
|
||||
values:
|
||||
ip: '10.0.0.5'
|
||||
ssh_key: '/vagrant/.vagrant/machines/solar-dev3/virtualbox/private_key'
|
||||
ssh_user: 'vagrant'
|
Loading…
x
Reference in New Issue
Block a user