Add container_cli used for the Overcloud to the Inventory
Some validations run commands on multiple containers and have to know if the Overcloud has been deployed using Docker or Podman. This patch gets the 'ContainerCli' variable from the Overcloud stack environment and adds it as an Overcloud vars. Change-Id: I7541bfd244acaf1d00d18b3eef031dbadfe4dd4a Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
parent
2c5d3f5f7d
commit
3153c449a2
|
@ -268,12 +268,18 @@ class TripleoInventory(object):
|
|||
|
||||
if children:
|
||||
vip_map = self.stack_outputs.get('VipMap', {})
|
||||
vips = {(vip_name + "_vip"): vip
|
||||
for vip_name, vip in vip_map.items()
|
||||
if vip and (vip_name in networks or vip_name == 'redis')}
|
||||
overcloud_vars = {
|
||||
(vip_name + "_vip"): vip for vip_name, vip in vip_map.items()
|
||||
if vip and (vip_name in networks or vip_name == 'redis')
|
||||
}
|
||||
|
||||
overcloud_vars['container_cli'] = \
|
||||
self.get_overcloud_environment().get(
|
||||
'parameter_defaults', {}).get('ContainerCli')
|
||||
|
||||
ret['overcloud'] = {
|
||||
'children': self._hosts(sorted(children)),
|
||||
'vars': vips
|
||||
'vars': overcloud_vars
|
||||
}
|
||||
|
||||
# Associate services with roles
|
||||
|
|
|
@ -104,7 +104,8 @@ class TestInventory(base.TestCase):
|
|||
|
||||
self.hclient = MagicMock()
|
||||
self.hclient.stacks.environment.return_value = {
|
||||
'parameter_defaults': {'AdminPassword': 'theadminpw'}}
|
||||
'parameter_defaults': {'AdminPassword': 'theadminpw',
|
||||
'ContainerCli': 'podman'}}
|
||||
self.mock_stack = MagicMock()
|
||||
self.mock_stack.outputs = self.outputs_data['outputs']
|
||||
self.hclient.stacks.get.return_value = self.mock_stack
|
||||
|
@ -195,6 +196,7 @@ class TestInventory(base.TestCase):
|
|||
'overcloud': {
|
||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||
'vars': {
|
||||
'container_cli': 'podman',
|
||||
'ctlplane_vip': 'x.x.x.4',
|
||||
'redis_vip': 'x.x.x.6'}},
|
||||
'Undercloud': {
|
||||
|
@ -275,6 +277,7 @@ class TestInventory(base.TestCase):
|
|||
'overcloud': {
|
||||
'children': ['Compute', 'Controller', 'CustomRole'],
|
||||
'vars': {
|
||||
'container_cli': 'podman',
|
||||
'ctlplane_vip': 'x.x.x.4',
|
||||
'redis_vip': 'x.x.x.6'}},
|
||||
'Undercloud': {
|
||||
|
@ -366,7 +369,8 @@ class TestInventory(base.TestCase):
|
|||
'overcloud': {'children': {'Compute': {},
|
||||
'Controller': {},
|
||||
'CustomRole': {}},
|
||||
'vars': {'ctlplane_vip': 'x.x.x.4',
|
||||
'vars': {'container_cli': 'podman',
|
||||
'ctlplane_vip': 'x.x.x.4',
|
||||
'redis_vip': 'x.x.x.6'}},
|
||||
'sa': {'children': {'Controller': {}},
|
||||
'vars': {'ansible_ssh_user': 'heat-admin'}},
|
||||
|
|
Loading…
Reference in New Issue