Skip to content

Commit

Permalink
Riak example ported to new transports
Browse files Browse the repository at this point in the history
  • Loading branch information
pigmej committed Sep 24, 2015
1 parent 2f5b663 commit eace132
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 18 deletions.
3 changes: 2 additions & 1 deletion examples/riak/riaks.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
def setup_riak():
db.clear()

nodes = vr.create('nodes', 'templates/riak_nodes.yaml', {})
resources = vr.create('nodes', 'templates/riak_nodes.yaml', {'count': 3})
nodes = [x for x in resources if x.name.startswith('node')]
node1, node2, node3 = nodes

riak_services = []
Expand Down
59 changes: 42 additions & 17 deletions templates/riak_nodes.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
id: simple_riak_cluster
id: simple_riak_with_transports
resources:
- id: node1
from: resources/ro_node
{% for i in range(count|int) %}
{% set j = i +1 %}
- id: ssh_transport{{j}}
from: resources/transport_ssh
values:
ip: '10.0.0.3'
name: 'node1'
ssh_key: '/vagrant/.vagrant/machines/solar-dev1/virtualbox/private_key'
ssh_user: 'vagrant'
- id: node2
from: resources/ro_node
ssh_key: '/vagrant/.vagrant/machines/solar-dev{{j}}/virtualbox/private_key'
- id: transports{{j}}
from: resources/transports
values:
ip: '10.0.0.4'
name: 'node2'
ssh_key: '/vagrant/.vagrant/machines/solar-dev2/virtualbox/private_key'
ssh_user: 'vagrant'
- id: node3
transports:key: ssh_transport{{j}}::ssh_key
transports:user: ssh_transport{{j}}::ssh_user
transports:port: ssh_transport{{j}}::ssh_port
transports:name: ssh_transport{{j}}::name
- id: node{{j}}
from: resources/ro_node
values:
ip: '10.0.0.5'
name: 'node3'
ssh_key: '/vagrant/.vagrant/machines/solar-dev3/virtualbox/private_key'
ssh_user: 'vagrant'
name: node{{j}}
ip: '10.0.0.{{i + 3}}'
transports_id: transports{{j}}::transports_id
{% endfor %}


# id: simple_riak_cluster
# resources:
# - id: node1
# from: resources/ro_node
# values:
# ip: '10.0.0.3'
# name: 'node1'
# 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'
# name: 'node2'
# 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'
# name: 'node3'
# ssh_key: '/vagrant/.vagrant/machines/solar-dev3/virtualbox/private_key'
# ssh_user: 'vagrant'

0 comments on commit eace132

Please sign in to comment.