Add enabled networks in the role as part of the inventory
This adds a list containing the enabled networks for the role as part of the inventory. Change-Id: I379bdea1499bef90ffab0f105c21743451516c89
This commit is contained in:
parent
8d86b0dbfb
commit
5a0ae09a21
@ -170,6 +170,9 @@ class TripleoInventory(object):
|
||||
ret[name]['vars'] = {
|
||||
'deploy_server_id': role_node_id_map[
|
||||
'server_ids'][role][idx]}
|
||||
# Add variable for listing enabled networks in the node
|
||||
ret[name]['vars']['enabled_networks'] = \
|
||||
[str(net) for net in role_net_ip_map[role]]
|
||||
# Add variable for IP on each network
|
||||
for net in role_net_ip_map[role]:
|
||||
ret[name]['vars']["%s_ip" % net] = \
|
||||
|
@ -158,13 +158,16 @@ class TestInventory(base.TestCase):
|
||||
def test_inventory_list(self):
|
||||
expected = {'c-0': {'hosts': ['x.x.x.1'],
|
||||
'vars': {'deploy_server_id': 'a',
|
||||
'ctlplane_ip': 'x.x.x.1'}},
|
||||
'ctlplane_ip': 'x.x.x.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'c-1': {'hosts': ['x.x.x.2'],
|
||||
'vars': {'deploy_server_id': 'b',
|
||||
'ctlplane_ip': 'x.x.x.2'}},
|
||||
'ctlplane_ip': 'x.x.x.2',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'c-2': {'hosts': ['x.x.x.3'],
|
||||
'vars': {'deploy_server_id': 'c',
|
||||
'ctlplane_ip': 'x.x.x.3'}},
|
||||
'ctlplane_ip': 'x.x.x.3',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'Compute': {
|
||||
'children': ['cp-0'],
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
@ -177,10 +180,12 @@ class TestInventory(base.TestCase):
|
||||
'role_name': 'Controller'}},
|
||||
'cp-0': {'hosts': ['y.y.y.1'],
|
||||
'vars': {'deploy_server_id': 'd',
|
||||
'ctlplane_ip': 'y.y.y.1'}},
|
||||
'ctlplane_ip': 'y.y.y.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'cs-0': {'hosts': ['z.z.z.1'],
|
||||
'vars': {'deploy_server_id': 'e',
|
||||
'ctlplane_ip': 'z.z.z.1'}},
|
||||
'ctlplane_ip': 'z.z.z.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'CustomRole': {
|
||||
'children': ['cs-0'],
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
@ -219,13 +224,16 @@ class TestInventory(base.TestCase):
|
||||
|
||||
expected = {'c-0': {'hosts': ['x.x.x.1'],
|
||||
'vars': {'deploy_server_id': 'a',
|
||||
'ctlplane_ip': 'x.x.x.1'}},
|
||||
'ctlplane_ip': 'x.x.x.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'c-1': {'hosts': ['x.x.x.2'],
|
||||
'vars': {'deploy_server_id': 'b',
|
||||
'ctlplane_ip': 'x.x.x.2'}},
|
||||
'ctlplane_ip': 'x.x.x.2',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'c-2': {'hosts': ['x.x.x.3'],
|
||||
'vars': {'deploy_server_id': 'c',
|
||||
'ctlplane_ip': 'x.x.x.3'}},
|
||||
'ctlplane_ip': 'x.x.x.3',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'Compute': {
|
||||
'children': ['cp-0'],
|
||||
'vars': {'ansible_ssh_user': 'my-custom-admin',
|
||||
@ -238,10 +246,12 @@ class TestInventory(base.TestCase):
|
||||
'role_name': 'Controller'}},
|
||||
'cp-0': {'hosts': ['y.y.y.1'],
|
||||
'vars': {'deploy_server_id': 'd',
|
||||
'ctlplane_ip': 'y.y.y.1'}},
|
||||
'ctlplane_ip': 'y.y.y.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'cs-0': {'hosts': ['z.z.z.1'],
|
||||
'vars': {'deploy_server_id': 'e',
|
||||
'ctlplane_ip': 'z.z.z.1'}},
|
||||
'ctlplane_ip': 'z.z.z.1',
|
||||
'enabled_networks': ['ctlplane']}},
|
||||
'CustomRole': {
|
||||
'children': ['cs-0'],
|
||||
'vars': {'ansible_ssh_user': 'my-custom-admin',
|
||||
|
Loading…
x
Reference in New Issue
Block a user