Remove role_data from inventory
role_data is extremely verbose and not actually needed since Idfdce6f0a778b0a7f2fed17ff56d1a3e451868ab landed. Removing it from the inventory will improve readability. Removing it also avoids issues with hostvars since the role_data_* keys are set as host variables and are not properly escaped when the task lists include jinja themselves. Change-Id: I06c9b3256567cc57d599bd4d9af617c718d2314f
This commit is contained in:
parent
6090d32b51
commit
f6349940e8
|
@ -194,7 +194,6 @@ class TripleoInventory(object):
|
|||
role_net_ip_map = self.stack_outputs.get('RoleNetIpMap', {})
|
||||
role_node_id_map = self.stack_outputs.get('ServerIdData', {})
|
||||
networks = set()
|
||||
role_data = self.stack_outputs.get('RoleData', {})
|
||||
role_net_hostname_map = self.stack_outputs.get(
|
||||
'RoleNetHostnameMap', {})
|
||||
children = []
|
||||
|
@ -229,16 +228,6 @@ class TripleoInventory(object):
|
|||
'role_name': role,
|
||||
}
|
||||
}
|
||||
# Note we add each individual key from role_data, because if
|
||||
# any template sections define inline ansible with j2 variables
|
||||
# ansible silently treats those inventory variables as
|
||||
# undefined
|
||||
# This at least means we can consume those keys which don't
|
||||
# have this problem (in general we don't need the nested
|
||||
# ansible *tasks because these are available via config
|
||||
# download already)
|
||||
for k in role_data[role]:
|
||||
ret[role]['vars']["role_data_%s" % k] = role_data[role][k]
|
||||
|
||||
if children:
|
||||
vip_map = self.stack_outputs.get('VipMap', {})
|
||||
|
|
|
@ -202,13 +202,11 @@ class TestInventory(base.TestCase):
|
|||
'children': ['cp-0'],
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo2',
|
||||
'role_name': 'Compute'}},
|
||||
'Controller': {
|
||||
'children': ['c-0', 'c-1', 'c-2'],
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo1',
|
||||
'role_name': 'Controller'}},
|
||||
'cp-0': {'hosts': ['y.y.y.1'],
|
||||
'vars': {'deploy_server_id': 'd',
|
||||
|
@ -222,7 +220,6 @@ class TestInventory(base.TestCase):
|
|||
'children': ['cs-0'],
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo3',
|
||||
'role_name': 'CustomRole'}},
|
||||
'overcloud': {
|
||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||
|
@ -291,13 +288,11 @@ class TestInventory(base.TestCase):
|
|||
'children': ['cp-0'],
|
||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo2',
|
||||
'role_name': 'Compute'}},
|
||||
'Controller': {
|
||||
'children': ['c-0', 'c-1', 'c-2'],
|
||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo1',
|
||||
'role_name': 'Controller'}},
|
||||
'cp-0': {'hosts': ['y.y.y.1'],
|
||||
'vars': {'deploy_server_id': 'd',
|
||||
|
@ -311,7 +306,6 @@ class TestInventory(base.TestCase):
|
|||
'children': ['cs-0'],
|
||||
'vars': {'ansible_ssh_user': ansible_ssh_user,
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo3',
|
||||
'role_name': 'CustomRole'}},
|
||||
'overcloud': {
|
||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||
|
@ -359,17 +353,14 @@ class TestInventory(base.TestCase):
|
|||
'Compute': {'children': {'cp-0': {}},
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo2',
|
||||
'role_name': 'Compute'}},
|
||||
'Controller': {'children': {'c-0': {}, 'c-1': {}, 'c-2': {}},
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo1',
|
||||
'role_name': 'Controller'}},
|
||||
'CustomRole': {'children': {'cs-0': {}},
|
||||
'vars': {'ansible_ssh_user': 'heat-admin',
|
||||
'bootstrap_server_id': 'a',
|
||||
'role_data_config_settings': 'foo3',
|
||||
'role_name': 'CustomRole'}},
|
||||
'_meta': {'hostvars': {}},
|
||||
'c-0': {'hosts': {'x.x.x.1': {}},
|
||||
|
|
Loading…
Reference in New Issue