Skip to content

Commit e853809

Browse files
committed
mgr/cephadm: optionally add kmip block to ganesha conf
If all the kmip fields were set Signed-off-by: Adam King <[email protected]> (cherry picked from commit ab33d16) Conflicts: src/pybind/mgr/cephadm/services/nfs.py Resolves: rhbz#2373703
1 parent bc3abd2 commit e853809

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/pybind/mgr/cephadm/services/nfs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ def generate_config(self, daemon_spec: CephadmDaemonDeploySpec) -> Tuple[Dict[st
121121
if monitoring_ip:
122122
daemon_spec.port_ips.update({str(monitoring_port): monitoring_ip})
123123

124+
add_kmip_block = (spec.kmip_cert and spec.kmip_key and spec.kmip_ca_cert and spec.kmip_host_list)
125+
124126
# generate the ganesha config
125127
def get_ganesha_conf() -> str:
126128
context: Dict[str, Any] = {
@@ -140,6 +142,7 @@ def get_ganesha_conf() -> str:
140142
"enable_nlm": str(spec.enable_nlm).lower(),
141143
"cluster_id": self.mgr._cluster_fsid,
142144
"enable_virtual_server": str(spec.enable_virtual_server).lower(),
145+
"kmip_addrs": spec.kmip_host_list if add_kmip_block else None,
143146
"use_old_nodeid": False if nodeid.isdigit() else True
144147
}
145148
if spec.enable_haproxy_protocol:

src/pybind/mgr/cephadm/templates/services/nfs/ganesha.conf.j2

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,17 @@ Ceph {
5353
}
5454
{% endif %}
5555

56+
{% if kmip_addrs %}
57+
KMIP {
58+
HOST {
59+
{% for kmip_addr in kmip_addrs %}
60+
addr = {{ kmip_addr }};
61+
{% endfor %}
62+
}
63+
cert = /etc/ganesha/kmip/kmip_cert.pem;
64+
key = /etc/ganesha/kmip/kmip_key.pem;
65+
ca = /etc/ganesha/kmip/kmip_ca_cert.pem;
66+
}
67+
{% endif %}
68+
5669
%url {{ url }}

0 commit comments

Comments
 (0)