mirror of
https://github.com/ceph/ceph
synced 2024-12-19 01:46:00 +00:00
4e1e929f75
Signed-off-by: Zack Cerza <zack.cerza@inktank.com>
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
"""
|
|
Set up client keyring
|
|
"""
|
|
import logging
|
|
|
|
from teuthology import misc as teuthology
|
|
from teuthology.orchestra import run
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
def create_keyring(ctx):
|
|
"""
|
|
Set up key ring on remote sites
|
|
"""
|
|
log.info('Setting up client nodes...')
|
|
clients = ctx.cluster.only(teuthology.is_type('client'))
|
|
testdir = teuthology.get_testdir(ctx)
|
|
coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir)
|
|
for remote, roles_for_host in clients.remotes.iteritems():
|
|
for id_ in teuthology.roles_of_type(roles_for_host, 'client'):
|
|
client_keyring = '/etc/ceph/ceph.client.{id}.keyring'.format(id=id_)
|
|
remote.run(
|
|
args=[
|
|
'sudo',
|
|
'adjust-ulimits',
|
|
'ceph-coverage',
|
|
coverage_dir,
|
|
'ceph-authtool',
|
|
'--create-keyring',
|
|
'--gen-key',
|
|
# TODO this --name= is not really obeyed, all unknown "types" are munged to "client"
|
|
'--name=client.{id}'.format(id=id_),
|
|
client_keyring,
|
|
run.Raw('&&'),
|
|
'sudo',
|
|
'chmod',
|
|
'0644',
|
|
client_keyring,
|
|
],
|
|
)
|