Add connections between nodes and hosts files
This commit is contained in:
parent
5aa795e701
commit
21474a496f
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user