Merge "Add tripleo_role_networks to inventory role group vars"
This commit is contained in:
commit
24e6ee25f8
|
@ -250,10 +250,6 @@ class TripleoInventory(object):
|
||||||
hosts[name].update({
|
hosts[name].update({
|
||||||
'deploy_server_id': role_node_id_map[
|
'deploy_server_id': role_node_id_map[
|
||||||
'server_ids'][role][idx]})
|
'server_ids'][role][idx]})
|
||||||
# Add variable for listing enabled networks in the node
|
|
||||||
hosts[name].update({
|
|
||||||
'enabled_networks':
|
|
||||||
[str(net) for net in role_net_ip_map[role]]})
|
|
||||||
# Add variable for IP on each network
|
# Add variable for IP on each network
|
||||||
for net in role_net_ip_map[role]:
|
for net in role_net_ip_map[role]:
|
||||||
hosts[name].update({
|
hosts[name].update({
|
||||||
|
@ -265,8 +261,6 @@ class TripleoInventory(object):
|
||||||
"%s_hostname" % net:
|
"%s_hostname" % net:
|
||||||
role_net_hostname_map[role][net][idx]})
|
role_net_hostname_map[role][net][idx]})
|
||||||
|
|
||||||
networks.update(hosts[name]['enabled_networks'])
|
|
||||||
|
|
||||||
children.append(role)
|
children.append(role)
|
||||||
|
|
||||||
if self.hosts_format_dict:
|
if self.hosts_format_dict:
|
||||||
|
@ -275,6 +269,11 @@ class TripleoInventory(object):
|
||||||
hosts_format = [h for h in hosts.keys()]
|
hosts_format = [h for h in hosts.keys()]
|
||||||
hosts_format.sort()
|
hosts_format.sort()
|
||||||
|
|
||||||
|
role_networks = sorted([
|
||||||
|
str(net) for net in role_net_ip_map[role]
|
||||||
|
])
|
||||||
|
networks.update(role_networks)
|
||||||
|
|
||||||
ret[role] = {
|
ret[role] = {
|
||||||
'hosts': hosts_format,
|
'hosts': hosts_format,
|
||||||
'vars': {
|
'vars': {
|
||||||
|
@ -282,6 +281,7 @@ class TripleoInventory(object):
|
||||||
'bootstrap_server_id': role_node_id_map.get(
|
'bootstrap_server_id': role_node_id_map.get(
|
||||||
'bootstrap_server_id'),
|
'bootstrap_server_id'),
|
||||||
'tripleo_role_name': role,
|
'tripleo_role_name': role,
|
||||||
|
'tripleo_role_networks': role_networks,
|
||||||
'serial': self.serial,
|
'serial': self.serial,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,15 @@ class TestInventories(base.TestCase):
|
||||||
],
|
],
|
||||||
"vars": {
|
"vars": {
|
||||||
"tripleo_role_name": "Controller",
|
"tripleo_role_name": "Controller",
|
||||||
|
"tripleo_role_networks": [
|
||||||
|
"management",
|
||||||
|
"storage",
|
||||||
|
"ctlplane",
|
||||||
|
"external",
|
||||||
|
"internal_api",
|
||||||
|
"storage_mgmt",
|
||||||
|
"tenant"
|
||||||
|
],
|
||||||
"serial": "1",
|
"serial": "1",
|
||||||
"ansible_ssh_user": "heat-admin",
|
"ansible_ssh_user": "heat-admin",
|
||||||
}
|
}
|
||||||
|
@ -129,15 +138,6 @@ class TestInventories(base.TestCase):
|
||||||
"tenant_ip": "192.168.24.12",
|
"tenant_ip": "192.168.24.12",
|
||||||
"internal_api_ip": "192.168.24.12",
|
"internal_api_ip": "192.168.24.12",
|
||||||
"management_ip": "192.168.24.12",
|
"management_ip": "192.168.24.12",
|
||||||
"enabled_networks": [
|
|
||||||
"management",
|
|
||||||
"storage",
|
|
||||||
"ctlplane",
|
|
||||||
"external",
|
|
||||||
"internal_api",
|
|
||||||
"storage_mgmt",
|
|
||||||
"tenant"
|
|
||||||
],
|
|
||||||
"ansible_host": "192.168.24.12"
|
"ansible_host": "192.168.24.12"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,15 @@ class TestInventories(base.TestCase):
|
||||||
],
|
],
|
||||||
"vars": {
|
"vars": {
|
||||||
"tripleo_role_name": "DistributedComputeHCI",
|
"tripleo_role_name": "DistributedComputeHCI",
|
||||||
|
"tripleo_role_networks": [
|
||||||
|
"management",
|
||||||
|
"storage",
|
||||||
|
"ctlplane",
|
||||||
|
"external",
|
||||||
|
"internal_api",
|
||||||
|
"storage_mgmt",
|
||||||
|
"tenant"
|
||||||
|
],
|
||||||
"serial": "1",
|
"serial": "1",
|
||||||
"ansible_ssh_user": "heat-admin",
|
"ansible_ssh_user": "heat-admin",
|
||||||
}
|
}
|
||||||
|
@ -223,15 +232,6 @@ class TestInventories(base.TestCase):
|
||||||
"tenant_ip": "192.168.24.13",
|
"tenant_ip": "192.168.24.13",
|
||||||
"internal_api_ip": "192.168.24.13",
|
"internal_api_ip": "192.168.24.13",
|
||||||
"management_ip": "192.168.24.13",
|
"management_ip": "192.168.24.13",
|
||||||
"enabled_networks": [
|
|
||||||
"management",
|
|
||||||
"storage",
|
|
||||||
"ctlplane",
|
|
||||||
"external",
|
|
||||||
"internal_api",
|
|
||||||
"storage_mgmt",
|
|
||||||
"tenant"
|
|
||||||
],
|
|
||||||
"ansible_host": "192.168.24.13"
|
"ansible_host": "192.168.24.13"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,20 +281,20 @@ class TestInventories(base.TestCase):
|
||||||
"tenant_ip": "192.168.24.12",
|
"tenant_ip": "192.168.24.12",
|
||||||
"internal_api_ip": "192.168.24.12",
|
"internal_api_ip": "192.168.24.12",
|
||||||
"management_ip": "192.168.24.12",
|
"management_ip": "192.168.24.12",
|
||||||
"enabled_networks": [
|
|
||||||
"management",
|
|
||||||
"storage",
|
|
||||||
"ctlplane",
|
|
||||||
"external",
|
|
||||||
"internal_api",
|
|
||||||
"storage_mgmt",
|
|
||||||
"tenant"
|
|
||||||
],
|
|
||||||
"ansible_host": "192.168.24.12"
|
"ansible_host": "192.168.24.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vars": {
|
"vars": {
|
||||||
"tripleo_role_name": "Controller",
|
"tripleo_role_name": "Controller",
|
||||||
|
"tripleo_role_networks": [
|
||||||
|
"management",
|
||||||
|
"storage",
|
||||||
|
"ctlplane",
|
||||||
|
"external",
|
||||||
|
"internal_api",
|
||||||
|
"storage_mgmt",
|
||||||
|
"tenant"
|
||||||
|
],
|
||||||
"serial": "1",
|
"serial": "1",
|
||||||
"ansible_ssh_user": "heat-admin",
|
"ansible_ssh_user": "heat-admin",
|
||||||
}
|
}
|
||||||
|
@ -353,20 +353,20 @@ class TestInventories(base.TestCase):
|
||||||
"tenant_ip": "192.168.24.13",
|
"tenant_ip": "192.168.24.13",
|
||||||
"internal_api_ip": "192.168.24.13",
|
"internal_api_ip": "192.168.24.13",
|
||||||
"management_ip": "192.168.24.13",
|
"management_ip": "192.168.24.13",
|
||||||
"enabled_networks": [
|
|
||||||
"management",
|
|
||||||
"storage",
|
|
||||||
"ctlplane",
|
|
||||||
"external",
|
|
||||||
"internal_api",
|
|
||||||
"storage_mgmt",
|
|
||||||
"tenant"
|
|
||||||
],
|
|
||||||
"ansible_host": "192.168.24.13"
|
"ansible_host": "192.168.24.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vars": {
|
"vars": {
|
||||||
"tripleo_role_name": "DistributedComputeHCI",
|
"tripleo_role_name": "DistributedComputeHCI",
|
||||||
|
"tripleo_role_networks": [
|
||||||
|
"management",
|
||||||
|
"storage",
|
||||||
|
"ctlplane",
|
||||||
|
"external",
|
||||||
|
"internal_api",
|
||||||
|
"storage_mgmt",
|
||||||
|
"tenant"
|
||||||
|
],
|
||||||
"serial": "1",
|
"serial": "1",
|
||||||
"ansible_ssh_user": "heat-admin",
|
"ansible_ssh_user": "heat-admin",
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,10 @@ class TestInventory(base.TestCase):
|
||||||
'Controller': {
|
'Controller': {
|
||||||
'ctlplane': ['c-0.ctlplane.localdomain',
|
'ctlplane': ['c-0.ctlplane.localdomain',
|
||||||
'c-1.ctlplane.localdomain',
|
'c-1.ctlplane.localdomain',
|
||||||
'c-2.ctlplane.localdomain']},
|
'c-2.ctlplane.localdomain'],
|
||||||
|
'internal_api': ['c-0.internal_api.localdomain',
|
||||||
|
'c-1.internal_api.localdomain',
|
||||||
|
'c-2.internal_api.localdomain']},
|
||||||
'Compute': {
|
'Compute': {
|
||||||
'ctlplane': ['cp-0.ctlplane.localdomain']},
|
'ctlplane': ['cp-0.ctlplane.localdomain']},
|
||||||
'CustomRole': {
|
'CustomRole': {
|
||||||
|
@ -87,7 +90,10 @@ class TestInventory(base.TestCase):
|
||||||
'Controller': {
|
'Controller': {
|
||||||
'ctlplane': ['x.x.x.1',
|
'ctlplane': ['x.x.x.1',
|
||||||
'x.x.x.2',
|
'x.x.x.2',
|
||||||
'x.x.x.3']},
|
'x.x.x.3'],
|
||||||
|
'internal_api': ['x.x.x.4',
|
||||||
|
'x.x.x.5',
|
||||||
|
'x.x.x.6']},
|
||||||
'Compute': {
|
'Compute': {
|
||||||
'ctlplane': ['y.y.y.1']},
|
'ctlplane': ['y.y.y.1']},
|
||||||
'CustomRole': {
|
'CustomRole': {
|
||||||
|
@ -190,20 +196,23 @@ class TestInventory(base.TestCase):
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Compute'}},
|
'tripleo_role_name': 'Compute',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'Controller': {
|
'Controller': {
|
||||||
'hosts': ['c-0', 'c-1', 'c-2'],
|
'hosts': ['c-0', 'c-1', 'c-2'],
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Controller'}},
|
'tripleo_role_name': 'Controller',
|
||||||
|
'tripleo_role_networks': ['ctlplane',
|
||||||
|
'internal_api']}},
|
||||||
'CustomRole': {
|
'CustomRole': {
|
||||||
'hosts': ['cs-0'],
|
'hosts': ['cs-0'],
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'CustomRole'}},
|
'tripleo_role_name': 'CustomRole',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'overcloud': {
|
'overcloud': {
|
||||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||||
'vars': {
|
'vars': {
|
||||||
|
@ -273,21 +282,25 @@ class TestInventory(base.TestCase):
|
||||||
'ansible_ssh_user': ansible_ssh_user,
|
'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Compute'}},
|
'tripleo_role_name': 'Compute',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'Controller': {
|
'Controller': {
|
||||||
'hosts': ['c-0', 'c-1', 'c-2'],
|
'hosts': ['c-0', 'c-1', 'c-2'],
|
||||||
'vars': {'ansible_python_interpreter': 'foo',
|
'vars': {'ansible_python_interpreter': 'foo',
|
||||||
'ansible_ssh_user': ansible_ssh_user,
|
'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Controller'}},
|
'tripleo_role_name': 'Controller',
|
||||||
|
'tripleo_role_networks': ['ctlplane',
|
||||||
|
'internal_api']}},
|
||||||
'CustomRole': {
|
'CustomRole': {
|
||||||
'hosts': ['cs-0'],
|
'hosts': ['cs-0'],
|
||||||
'vars': {'ansible_python_interpreter': 'foo',
|
'vars': {'ansible_python_interpreter': 'foo',
|
||||||
'ansible_ssh_user': ansible_ssh_user,
|
'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'CustomRole'}},
|
'tripleo_role_name': 'CustomRole',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'overcloud': {
|
'overcloud': {
|
||||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||||
'vars': {
|
'vars': {
|
||||||
|
@ -370,48 +383,56 @@ class TestInventory(base.TestCase):
|
||||||
'ansible_host': 'y.y.y.1',
|
'ansible_host': 'y.y.y.1',
|
||||||
'ctlplane_ip': 'y.y.y.1',
|
'ctlplane_ip': 'y.y.y.1',
|
||||||
'deploy_server_id': 'd',
|
'deploy_server_id': 'd',
|
||||||
'enabled_networks': ['ctlplane'],
|
|
||||||
'ctlplane_hostname': 'cp-0.ctlplane.localdomain'}},
|
'ctlplane_hostname': 'cp-0.ctlplane.localdomain'}},
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Compute'}},
|
'tripleo_role_name': 'Compute',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'Controller': {
|
'Controller': {
|
||||||
'hosts': {
|
'hosts': {
|
||||||
'c-0': {
|
'c-0': {
|
||||||
'ansible_host': 'x.x.x.1',
|
'ansible_host': 'x.x.x.1',
|
||||||
'ctlplane_ip': 'x.x.x.1',
|
'ctlplane_ip': 'x.x.x.1',
|
||||||
'deploy_server_id': 'a',
|
'deploy_server_id': 'a',
|
||||||
'enabled_networks': ['ctlplane'],
|
'ctlplane_hostname': 'c-0.ctlplane.localdomain',
|
||||||
'ctlplane_hostname': 'c-0.ctlplane.localdomain'},
|
'internal_api_hostname':
|
||||||
|
'c-0.internal_api.localdomain',
|
||||||
|
'internal_api_ip': 'x.x.x.4'},
|
||||||
'c-1': {
|
'c-1': {
|
||||||
'ansible_host': 'x.x.x.2',
|
'ansible_host': 'x.x.x.2',
|
||||||
'ctlplane_ip': 'x.x.x.2',
|
'ctlplane_ip': 'x.x.x.2',
|
||||||
'deploy_server_id': 'b',
|
'deploy_server_id': 'b',
|
||||||
'enabled_networks': ['ctlplane'],
|
'ctlplane_hostname': 'c-1.ctlplane.localdomain',
|
||||||
'ctlplane_hostname': 'c-1.ctlplane.localdomain'},
|
'internal_api_hostname':
|
||||||
|
'c-1.internal_api.localdomain',
|
||||||
|
'internal_api_ip': 'x.x.x.5'},
|
||||||
'c-2': {
|
'c-2': {
|
||||||
'ansible_host': 'x.x.x.3',
|
'ansible_host': 'x.x.x.3',
|
||||||
'ctlplane_ip': 'x.x.x.3',
|
'ctlplane_ip': 'x.x.x.3',
|
||||||
'deploy_server_id': 'c',
|
'deploy_server_id': 'c',
|
||||||
'enabled_networks': ['ctlplane'],
|
'ctlplane_hostname': 'c-2.ctlplane.localdomain',
|
||||||
'ctlplane_hostname': 'c-2.ctlplane.localdomain'}},
|
'internal_api_hostname':
|
||||||
|
'c-2.internal_api.localdomain',
|
||||||
|
'internal_api_ip': 'x.x.x.6'}},
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'Controller'}},
|
'tripleo_role_name': 'Controller',
|
||||||
|
'tripleo_role_networks': ['ctlplane',
|
||||||
|
'internal_api']}},
|
||||||
'CustomRole': {
|
'CustomRole': {
|
||||||
'hosts': {
|
'hosts': {
|
||||||
'cs-0': {
|
'cs-0': {
|
||||||
'ansible_host': 'z.z.z.1',
|
'ansible_host': 'z.z.z.1',
|
||||||
'ctlplane_ip': 'z.z.z.1',
|
'ctlplane_ip': 'z.z.z.1',
|
||||||
'deploy_server_id': 'e',
|
'deploy_server_id': 'e',
|
||||||
'enabled_networks': ['ctlplane'],
|
|
||||||
'ctlplane_hostname': 'cs-0.ctlplane.localdomain'}},
|
'ctlplane_hostname': 'cs-0.ctlplane.localdomain'}},
|
||||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||||
'bootstrap_server_id': 'a',
|
'bootstrap_server_id': 'a',
|
||||||
'serial': 1,
|
'serial': 1,
|
||||||
'tripleo_role_name': 'CustomRole'}},
|
'tripleo_role_name': 'CustomRole',
|
||||||
|
'tripleo_role_networks': ['ctlplane']}},
|
||||||
'overcloud': {'children': {'Compute': {},
|
'overcloud': {'children': {'Compute': {},
|
||||||
'Controller': {},
|
'Controller': {},
|
||||||
'CustomRole': {}},
|
'CustomRole': {}},
|
||||||
|
|
Loading…
Reference in New Issue