log.info("'use_existing_cluster' is true; skipping cluster creation")
yield
+ cephx = config['cephx']
+ key_type = cephx.get('key_type', None)
+ auth_tool_extra_args = []
+ if key_type is not None:
+ auth_tool_extra_args.append(f'--key-type={key_type}')
+
testdir = teuthology.get_testdir(ctx)
cluster_name = config['cluster']
data_dir = '{tdir}/{cluster}.data'.format(tdir=testdir, cluster=cluster_name)
firstmon = teuthology.get_first_mon(ctx, config, cluster_name)
log.info('Setting up %s...' % firstmon)
+ authtool = [
+ 'sudo',
+ 'adjust-ulimits',
+ 'ceph-coverage',
+ coverage_dir,
+ 'ceph-authtool',
+ *auth_tool_extra_args,
+ ]
ctx.cluster.only(firstmon).run(
args=[
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
'--create-keyring',
keyring_path,
],
)
ctx.cluster.only(firstmon).run(
args=[
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
'--gen-key',
'--name=mon.',
keyring_path,
log.info('Creating admin key on %s...' % firstmon)
ctx.cluster.only(firstmon).run(
args=[
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
'--gen-key',
'--name=client.admin',
'--cap', 'mon', 'allow *',
'-p',
mgr_dir,
run.Raw('&&'),
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
'--create-keyring',
'--gen-key',
'--name=mgr.{id}'.format(id=id_),
'-p',
mds_dir,
run.Raw('&&'),
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
'--create-keyring',
'--gen-key',
'--name=mds.{id}'.format(id=id_),
for role in teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name):
_, _, id_ = teuthology.split_role(role)
- mnt_point = DATA_PATH.format(
- type_='osd', cluster=cluster_name, id_=id_)
+
+ mnt_point = DATA_PATH.format(type_='osd', cluster=cluster_name, id_=id_)
remote.run(
args=[
'sudo',
for role in teuthology.cluster_roles_of_type(roles_for_host, 'osd', cluster_name):
_, _, id_ = teuthology.split_role(role)
+
+ osd_dir = DATA_PATH.format(type_='osd', cluster=cluster_name, id_=id_)
+ remote.run(
+ args=[
+ *authtool,
+ '--create-keyring',
+ '--gen-key',
+ '--name=osd.{id}'.format(id=id_),
+ osd_dir + '/keyring',
+ ],
+ )
+
try:
args = ['sudo',
'MALLOC_CHECK_=3',
'--no-mon-config',
'--cluster', cluster_name,
'--mkfs',
- '--mkkey',
'-i', id_,
'--monmap', monmap_path]
log_path = f'/var/log/ceph/{cluster_name}-osd.{id_}.log'
'--cluster',
cluster_name,
'--mkfs',
- '--mkkey',
'-i', id_,
'--monmap', monmap_path,
],
run.wait(
mons.run(
args=[
- 'sudo',
- 'adjust-ulimits',
- 'ceph-coverage',
- coverage_dir,
- 'ceph-authtool',
+ *authtool,
keyring_path,
'--name={type}.{id}'.format(
type=type_,
cluster=config['cluster'],
mon_bind_msgr2=config.get('mon_bind_msgr2', True),
mon_bind_addrvec=config.get('mon_bind_addrvec', True),
+ cephx=config.get('cephx', {}),
)),
lambda: run_daemon(ctx=ctx, config=config, type_='mon'),
lambda: module_setup(ctx=ctx, config=config),