Ensure we're using the stackname for the inventory

Until now, the inventory path used by the overcloud_delete.py was wrong,
since it wasn't using the "stackname", leading to a wrong
/home/stack/config-download/{}/tripleo-ansible-inventory.yaml path.

While it's not a big issue with non-TLS-e deploy, it becomes an actual
problem when we involve FreeIPA and TLS-e, since the deletion won't
remove the nodes nor services from FreeIPA.

Closes-Bug: #1950155

Change-Id: I5941bf9948c5f17e7406d34c21b8de9bd174c063
(cherry picked from commit 9fd913f57c)
This commit is contained in:
Cédric Jeanneret 2021-11-08 12:32:09 +01:00 committed by Cedric Jeanneret
parent 64e18ce01a
commit 914709dd74
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ class TestDeleteOvercloud(deploy_fakes.TestDeployOvercloud):
mock_run_playbook.assert_called_once_with(
['cli-cleanup-ipa.yml', 'cli-overcloud-delete.yaml'],
constants.ANSIBLE_INVENTORY,
constants.ANSIBLE_INVENTORY.format('overcast'),
mock.ANY,
constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
extra_vars={
@ -82,7 +82,7 @@ class TestDeleteOvercloud(deploy_fakes.TestDeployOvercloud):
'cli-overcloud-node-unprovision.yaml',
'localhost,',
mock.ANY,
constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
constants.ANSIBLE_TRIPLEO_PLAYBOOKS.format('overcast'),
extra_vars={
"stack_name": "overcast",
"baremetal_deployment": mock.ANY,
@ -152,7 +152,7 @@ class TestDeleteOvercloud(deploy_fakes.TestDeployOvercloud):
mock_run_playbook.assert_called_once_with(
['cli-overcloud-delete.yaml'],
constants.ANSIBLE_INVENTORY,
constants.ANSIBLE_INVENTORY.format('overcast'),
mock.ANY,
constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
extra_vars={

View File

@ -115,7 +115,7 @@ class DeleteOvercloud(command.Command):
with utils.TempDirs() as tmp:
utils.run_ansible_playbook(
playbooks,
constants.ANSIBLE_INVENTORY,
constants.ANSIBLE_INVENTORY.format(parsed_args.stack),
workdir=tmp,
playbook_dir=constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
verbosity=utils.playbook_verbosity(self=self),