Merge ansible_group_vars in THT

This removes merging of ansible_group_vars when
downloading config, as we now merge them from the
ServiceChains in THT in order to better manage them
at one place.

ExtraGroupVars override what's set in the services.

Depends-On: https://review.opendev.org/c/openstack/tripleo-heat-templates/+/796135
Change-Id: I092a6bfb64d434e51b6434eb8216e0fd8dfb2187
This commit is contained in:
ramishra 2021-06-14 10:07:13 +05:30
parent de2e8a3026
commit 1fa0990327
2 changed files with 2 additions and 18 deletions

View File

@ -331,19 +331,13 @@ class TestConfig(base.TestCase):
'uuid': 2}, 'uuid': 2},
'overcloud-novacompute-2': { 'overcloud-novacompute-2': {
'uuid': 3}}}}, 'uuid': 3}}}},
{'output_key': 'RoleData',
'output_value': {
'Controller': {
'ansible_group_vars': {
'chrony_host': 'localhost',
'chrony_acl': 'none',
}}}},
{'output_key': 'RoleGroupVars', {'output_key': 'RoleGroupVars',
'output_value': { 'output_value': {
'Controller': { 'Controller': {
'any_errors_fatal': True, 'any_errors_fatal': True,
'chrony_host': '192.168.2.1', 'chrony_host': '192.168.2.1',
'chrony_foo': 'bar', 'chrony_foo': 'bar',
'chrony_acl': 'none',
'max_fail_percentage': 15}, 'max_fail_percentage': 15},
'Compute': { 'Compute': {
'any_errors_fatal': True, 'any_errors_fatal': True,
@ -745,19 +739,13 @@ class TestConfig(base.TestCase):
'a7db3010-a51f-4ae0-a791-2364d629d20d', 'a7db3010-a51f-4ae0-a791-2364d629d20d',
'8b07cd31-3083-4b88-a433-955f72039e2c', '8b07cd31-3083-4b88-a433-955f72039e2c',
'169b46f8-1965-4d90-a7de-f36fb4a830fe']}}}, '169b46f8-1965-4d90-a7de-f36fb4a830fe']}}},
{'output_key': 'RoleData',
'output_value': {
'Controller': {
'ansible_group_vars': {
'chrony_host': 'localhost',
'chrony_acl': 'none',
}}}},
{'output_key': 'RoleGroupVars', {'output_key': 'RoleGroupVars',
'output_value': { 'output_value': {
'Controller': { 'Controller': {
'any_errors_fatal': True, 'any_errors_fatal': True,
'chrony_host': '192.168.2.1', 'chrony_host': '192.168.2.1',
'chrony_foo': 'bar', 'chrony_foo': 'bar',
'chrony_acl': 'none',
'max_fail_percentage': 15}, 'max_fail_percentage': 15},
'Compute': { 'Compute': {
'any_errors_fatal': True, 'any_errors_fatal': True,

View File

@ -261,10 +261,6 @@ class Config(object):
filepath = os.path.join(role_path, 'param_config.json') filepath = os.path.join(role_path, 'param_config.json')
with self._open_file(filepath) as param_config: with self._open_file(filepath) as param_config:
param_config.write(json.dumps(role[config])) param_config.write(json.dumps(role[config]))
elif config == 'ansible_group_vars':
role_config = role[config].copy()
role_config.update(role_group_vars[role_name])
role_group_vars[role_name] = role_config
else: else:
# NOTE(emilien): Move this condition to the # NOTE(emilien): Move this condition to the
# upper level once THT is adapted for all tasks to be # upper level once THT is adapted for all tasks to be