From 28537d03199cf2ca73e188566a469a773ac086c7 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Wed, 9 Mar 2022 19:19:04 +0000 Subject: [PATCH] Support passing arbitrary cephadm arguments at bootstrap If an operator runs "openstack overcloud ceph deploy --cephadm-extra-args '--log-to-file --skip-prepare-host'", then the cephadm boostrap will use the --log-to-file and --skip-prepare-host options. Conflicts tripleoclient/v2/overcloud_ceph.py Depends-On: Ifa997432a93c55eb28f9a7847064ada826e09dd6 Change-Id: Iac58605dcb6289055fe6bbdd0a0b56c18c083251 (cherry picked from commit 299a40dab996f043392d8a2e2f421841b3f92c86) --- tripleoclient/v2/overcloud_ceph.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tripleoclient/v2/overcloud_ceph.py b/tripleoclient/v2/overcloud_ceph.py index 3f485fdc5..d222dbebf 100644 --- a/tripleoclient/v2/overcloud_ceph.py +++ b/tripleoclient/v2/overcloud_ceph.py @@ -164,6 +164,17 @@ class OvercloudCephDeploy(command.Command): "Path to an existing ceph.conf with settings " "to be assimilated by the new cluster via " "'cephadm bootstrap --config' ")), + parser.add_argument('--cephadm-extra-args', + help=_( + "String of extra parameters to pass cephadm. " + "E.g. if --cephadm-extra-args '--log-to-file " + " --skip-prepare-host', then cephadm boostrap " + "will use those options. Warning: requires " + "--force as not all possible options ensure a " + "functional deployment.")), + parser.add_argument('--force', default=False, + action='store_true', + help=_("Run command regardless of consequences.")) parser.add_argument('--single-host-defaults', default=False, action='store_true', help=_("Adjust configuration defaults to suit " @@ -352,6 +363,12 @@ class OvercloudCephDeploy(command.Command): else: extra_vars['crush_hierarchy_path'] = \ os.path.abspath(parsed_args.crush_hierarchy) + if parsed_args.cephadm_extra_args and not parsed_args.force: + raise oscexc.CommandError( + "--cephadm-extra-args requires --force.") + if parsed_args.cephadm_extra_args and parsed_args.force: + extra_vars['tripleo_cephadm_extra_args'] = \ + parsed_args.cephadm_extra_args # optional container vars to pass to playbook keys = ['ceph_namespace', 'ceph_image', 'ceph_tag'] push_sub_keys = ['ceph_namespace']