diff --git a/tripleo_common/inventory.py b/tripleo_common/inventory.py index 495389f1d..74ea66823 100644 --- a/tripleo_common/inventory.py +++ b/tripleo_common/inventory.py @@ -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', {}) diff --git a/tripleo_common/tests/test_inventory.py b/tripleo_common/tests/test_inventory.py index 85ccde826..0e0a8a5f8 100644 --- a/tripleo_common/tests/test_inventory.py +++ b/tripleo_common/tests/test_inventory.py @@ -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': {}},