Merge "Add option to skip ipa cleanup when deleting overclouds" into stable/train
This commit is contained in:
commit
b5e5e6df53
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
The `overcloud delete` subcommand now supports cleaning up overcloud hosts,
|
||||
services, and DNS entries in FreeIPA. This is applicable to deployments
|
||||
with TLS support enabled since FreeIPA serves DNS and manages certificates
|
||||
for overcloud infrastructure. This subcommand also includes a new option
|
||||
called ``--skip-ipa-cleanup`` that allows the caller to forego cleaning up
|
||||
FreeIPA. This may be useful when deployers want to forcibly cleanup
|
||||
overcloud stacks and leave FreeIPA entries intact (e.g., network partition
|
||||
events where the FreeIPA server isn't reachable). Note that you will need
|
||||
to manually cleanup FreeIPA if you use ``--skip-ipa-cleanup``.
|
|
@ -131,3 +131,19 @@ class TestDeleteOvercloud(fakes.TestDeployOvercloud):
|
|||
"/usr/share/ansible/tripleo-playbooks/cli-cleanup-ipa.yml "
|
||||
"did not complete successfully."
|
||||
)
|
||||
|
||||
@mock.patch(
|
||||
"tripleoclient.v1.overcloud_delete.DeleteOvercloud._cleanup_ipa",
|
||||
autospec=True)
|
||||
def test_skip_ipa_cleanup(self, mock_overcloud_delete):
|
||||
arglist = ["overcast", "-y", "--skip-ipa-cleanup"]
|
||||
verifylist = [
|
||||
("stack", "overcast"),
|
||||
("yes", True),
|
||||
("skip_ipa_cleanup", True)
|
||||
]
|
||||
|
||||
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
||||
self.cmd.take_action(parsed_args)
|
||||
|
||||
mock_overcloud_delete.assert_not_called()
|
||||
|
|
|
@ -49,6 +49,18 @@ class DeleteOvercloud(command.Command):
|
|||
help=_('Skip yes/no prompt (assume yes).'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
parser.add_argument('-s', '--skip-ipa-cleanup',
|
||||
help=_('Skip removing overcloud hosts, services, '
|
||||
'and DNS records from FreeIPA. This is '
|
||||
'particularly relevant for deployments '
|
||||
'using certificates from FreeIPA for TLS. '
|
||||
'By default, overcloud hosts, services, '
|
||||
'and DNS records will be removed from '
|
||||
'FreeIPA before deleting the overcloud. '
|
||||
'Using this option might require you to '
|
||||
'manually cleanup FreeIPA later.'),
|
||||
default=False,
|
||||
action="store_true")
|
||||
return parser
|
||||
|
||||
def _validate_args(self, parsed_args):
|
||||
|
@ -149,7 +161,8 @@ class DeleteOvercloud(command.Command):
|
|||
|
||||
clients = self.app.client_manager
|
||||
|
||||
self._cleanup_ipa(parsed_args.stack)
|
||||
if not parsed_args.skip_ipa_cleanup:
|
||||
self._cleanup_ipa(parsed_args.stack)
|
||||
self._plan_undeploy(clients, parsed_args.stack)
|
||||
self._plan_delete(clients, parsed_args.stack)
|
||||
print("Success.")
|
||||
|
|
Loading…
Reference in New Issue