Add connections between nodes and hosts files

This commit is contained in:
Dmitry Shulyak 2015-12-10 13:29:21 +02:00
parent 5aa795e701
commit 21474a496f

View File

@ -12,5 +12,28 @@ def run():
resources = vr.create('nodes', 'templates/nodes.yaml', {'count': 2})
node1, node2 = [x for x in resources if x.name.startswith('node')]
hosts1, hosts2 = [x for x in resources
if x.name.startswith('hosts_file')]
node1.connect(hosts1, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node2.connect(hosts1, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node1.connect(hosts2, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
node2.connect(hosts2, {
'name': 'hosts:name',
'ip': 'hosts:ip',
})
run()