mirror of
https://github.com/ceph/ceph
synced 2025-02-22 02:27:29 +00:00
mgr/cephadm: add rados_id to nvmeof conf
This is going to be used as the rados_id to be set when connecting to the cluster using the keyring we generate for the nvmeof daemon. The python librados library defaults the name to "client.admin" and so if we don't provide a name or rados_id, we'll only be able to use nvmeof with the "client.admin" keyring Signed-off-by: Adam King <adking@redhat.com>
This commit is contained in:
parent
7195fb2ae1
commit
3e8ad229f7
@ -36,14 +36,17 @@ class NvmeofService(CephService):
|
||||
|
||||
# TODO: check if we can force jinja2 to generate dicts with double quotes instead of using json.dumps
|
||||
transport_tcp_options = json.dumps(spec.transport_tcp_options) if spec.transport_tcp_options else None
|
||||
name = '{}.{}'.format(utils.name_to_config_section('nvmeof'), igw_id)
|
||||
rados_id = name[len('client.'):] if name.startswith('client.') else name
|
||||
context = {
|
||||
'spec': spec,
|
||||
'name': '{}.{}'.format(utils.name_to_config_section('nvmeof'), igw_id),
|
||||
'name': name,
|
||||
'addr': self.mgr.get_mgr_ip(),
|
||||
'port': spec.port,
|
||||
'log_level': 'WARN',
|
||||
'rpc_socket': '/var/tmp/spdk.sock',
|
||||
'transport_tcp_options': transport_tcp_options
|
||||
'transport_tcp_options': transport_tcp_options,
|
||||
'rados_id': rados_id
|
||||
}
|
||||
gw_conf = self.mgr.template.render('services/nvmeof/ceph-nvmeof.conf.j2', context)
|
||||
|
||||
|
@ -11,6 +11,7 @@ state_update_interval_sec = 5
|
||||
[ceph]
|
||||
pool = {{ spec.pool }}
|
||||
config_file = /etc/ceph/ceph.conf
|
||||
id = {{ rados_id }}
|
||||
|
||||
[mtls]
|
||||
server_key = {{ spec.server_key }}
|
||||
|
@ -379,6 +379,7 @@ state_update_interval_sec = 5
|
||||
[ceph]
|
||||
pool = {pool}
|
||||
config_file = /etc/ceph/ceph.conf
|
||||
id = nvmeof.{nvmeof_daemon_id}
|
||||
|
||||
[mtls]
|
||||
server_key = ./server.key
|
||||
|
Loading…
Reference in New Issue
Block a user