bnr - Set properly the default inventory file

The default path is addressed to /home/stack/tripleo-inventory.yaml.
The new release the inventory is generated automatically and the path is not that one.

Also the inventory argument in the restoration command has been added

Change-Id: I0093bf9c1c8346963b6fc299527e37b7698c51ce
This commit is contained in:
Fernando Diaz 2022-02-22 08:59:41 +01:00
parent 8cf6f78897
commit 719a26aaf1
3 changed files with 19 additions and 5 deletions

View File

@ -26,6 +26,8 @@ from tripleoclient import utils
LOG = logging.getLogger(__name__ + ".BackupOvercloud")
INVENTORY = constants.ANSIBLE_INVENTORY.format('overcloud')
class BackupOvercloud(command.Command):
"""Backup the Overcloud"""
@ -91,10 +93,10 @@ class BackupOvercloud(command.Command):
parser.add_argument(
'--inventory',
default='/home/stack/tripleo-inventory.yaml',
default=INVENTORY,
help=_("Tripleo inventory file generated with "
"tripleo-ansible-inventory command. "
"Defaults to: /home/stack/tripleo-inventory.yaml.")
"Defaults to: " + INVENTORY)
)
parser.add_argument(

View File

@ -28,6 +28,8 @@ from tripleoclient import utils
LOG = logging.getLogger(__name__ + ".RestoreOvercloud")
INVENTORY = constants.ANSIBLE_INVENTORY.format('overcloud')
class RestoreOvercloud(command.Command):
"""Restore the Overcloud"""
@ -39,6 +41,14 @@ class RestoreOvercloud(command.Command):
add_help=False
)
parser.add_argument(
'--inventory',
default=INVENTORY,
help=_("Tripleo inventory file generated with "
"tripleo-ansible-inventory command. "
"Defaults to: " + INVENTORY)
)
parser.add_argument(
'--stack',
nargs='?',
@ -102,7 +112,7 @@ class RestoreOvercloud(command.Command):
self._run_ansible_playbook(
playbook='cli-overcloud-restore-node.yaml',
inventory=constants.ANSIBLE_INVENTORY.format(parsed_args.stack),
inventory=parsed_args.inventory,
tags=None,
skip_tags=None,
extra_vars=extra_vars,

View File

@ -26,6 +26,8 @@ from tripleoclient import utils
LOG = logging.getLogger(__name__ + ".BackupUndercloud")
INVENTORY = constants.ANSIBLE_INVENTORY.format('overcloud')
class BackupUndercloud(command.Command):
"""Backup the undercloud"""
@ -95,10 +97,10 @@ class BackupUndercloud(command.Command):
parser.add_argument(
'--inventory',
action='store',
default='/home/stack/tripleo-inventory.yaml',
default=INVENTORY,
help=_("Tripleo inventory file generated with "
"tripleo-ansible-inventory command. "
"Defaults to: /home/stack/tripleo-inventory.yaml.")
"Defaults to: " + INVENTORY)
)
# Parameter to choose the files to backup