Add --mon-ip option to deployed ceph
Add --mon-ip option to 'openstack overcloud ceph deploy', to easily override the variable tripleo_cephadm_first_mon_ip from the CLI. This option makes deployed ceph easier when using standalone. Change-Id: Id9a61356e8fd4618ce68faa2677f4ed30981b7d6
This commit is contained in:
parent
294e42f599
commit
2ac3953410
tripleoclient
@ -44,6 +44,7 @@ class TestOvercloudCephDeploy(fakes.FakePlaybookExecution):
|
|||||||
arglist = ['deployed-metal.yaml', '--yes',
|
arglist = ['deployed-metal.yaml', '--yes',
|
||||||
'--stack', 'overcloud',
|
'--stack', 'overcloud',
|
||||||
'--skip-user-create',
|
'--skip-user-create',
|
||||||
|
'--mon-ip', '127.0.0.1',
|
||||||
'--cephadm-ssh-user', 'jimmy',
|
'--cephadm-ssh-user', 'jimmy',
|
||||||
'--output', 'deployed-ceph.yaml',
|
'--output', 'deployed-ceph.yaml',
|
||||||
'--container-namespace', 'quay.io/ceph',
|
'--container-namespace', 'quay.io/ceph',
|
||||||
@ -65,6 +66,7 @@ class TestOvercloudCephDeploy(fakes.FakePlaybookExecution):
|
|||||||
"working_dir": mock.ANY,
|
"working_dir": mock.ANY,
|
||||||
"stack_name": 'overcloud',
|
"stack_name": 'overcloud',
|
||||||
'tripleo_cephadm_ssh_user': 'jimmy',
|
'tripleo_cephadm_ssh_user': 'jimmy',
|
||||||
|
'tripleo_cephadm_first_mon_ip': '127.0.0.1',
|
||||||
'tripleo_roles_path': mock.ANY,
|
'tripleo_roles_path': mock.ANY,
|
||||||
'tripleo_cephadm_container_ns': 'quay.io/ceph',
|
'tripleo_cephadm_container_ns': 'quay.io/ceph',
|
||||||
'tripleo_cephadm_container_image': 'ceph',
|
'tripleo_cephadm_container_image': 'ceph',
|
||||||
|
@ -146,6 +146,14 @@ class OvercloudCephDeploy(command.Command):
|
|||||||
"used for the Ceph cluster_network. "
|
"used for the Ceph cluster_network. "
|
||||||
"Defaults to 'storage_mgmt'."),
|
"Defaults to 'storage_mgmt'."),
|
||||||
default='storage_mgmt')
|
default='storage_mgmt')
|
||||||
|
parser.add_argument('--mon-ip',
|
||||||
|
help=_(
|
||||||
|
"IP address of the first Ceph monitor. "
|
||||||
|
"If not set, an IP from the Ceph "
|
||||||
|
"public_network of a server with the "
|
||||||
|
"mon label from the Ceph spec is used. "
|
||||||
|
"IP must already be active on server."),
|
||||||
|
default='')
|
||||||
parser.add_argument('--config',
|
parser.add_argument('--config',
|
||||||
help=_(
|
help=_(
|
||||||
"Path to an existing ceph.conf with settings "
|
"Path to an existing ceph.conf with settings "
|
||||||
@ -301,6 +309,15 @@ class OvercloudCephDeploy(command.Command):
|
|||||||
parsed_args.cluster_network_name)
|
parsed_args.cluster_network_name)
|
||||||
extra_vars = {**extra_vars, **ceph_networks_map}
|
extra_vars = {**extra_vars, **ceph_networks_map}
|
||||||
|
|
||||||
|
if parsed_args.mon_ip:
|
||||||
|
if not oooutils.is_valid_ip(parsed_args.mon_ip):
|
||||||
|
raise oscexc.CommandError(
|
||||||
|
"Invalid IP address '%s' passed to --mon-ip."
|
||||||
|
% parsed_args.mon_ip)
|
||||||
|
else:
|
||||||
|
extra_vars['tripleo_cephadm_first_mon_ip'] = \
|
||||||
|
parsed_args.mon_ip
|
||||||
|
|
||||||
if parsed_args.ceph_spec:
|
if parsed_args.ceph_spec:
|
||||||
if not os.path.exists(parsed_args.ceph_spec):
|
if not os.path.exists(parsed_args.ceph_spec):
|
||||||
raise oscexc.CommandError(
|
raise oscexc.CommandError(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user