]> git.proxmox.com Git - ceph.git/blame - ceph/qa/tasks/ceph_client.py
import ceph quincy 17.2.4
[ceph.git] / ceph / qa / tasks / ceph_client.py
CommitLineData
7c673cae
FG
1"""
2Set up client keyring
3"""
4import logging
5
6from teuthology import misc as teuthology
7from teuthology.orchestra import run
8
9log = logging.getLogger(__name__)
10
11def create_keyring(ctx, cluster_name):
12 """
13 Set up key ring on remote sites
14 """
15 log.info('Setting up client nodes...')
16 clients = ctx.cluster.only(teuthology.is_type('client', cluster_name))
17 testdir = teuthology.get_testdir(ctx)
18 coverage_dir = '{tdir}/archive/coverage'.format(tdir=testdir)
9f95a23c 19 for remote, roles_for_host in clients.remotes.items():
7c673cae
FG
20 for role in teuthology.cluster_roles_of_type(roles_for_host, 'client',
21 cluster_name):
22 name = teuthology.ceph_role(role)
23 client_keyring = '/etc/ceph/{0}.{1}.keyring'.format(cluster_name, name)
24 remote.run(
25 args=[
26 'sudo',
27 'adjust-ulimits',
28 'ceph-coverage',
29 coverage_dir,
30 'ceph-authtool',
31 '--create-keyring',
32 '--gen-key',
33 # TODO this --name= is not really obeyed, all unknown "types" are munged to "client"
34 '--name={name}'.format(name=name),
35 client_keyring,
36 run.Raw('&&'),
37 'sudo',
38 'chmod',
39 '0644',
40 client_keyring,
41 ],
42 )