Enable_UDP = false;
NFS_Port = {{ port }};
allow_set_io_flusher_fail = true;
+{% if haproxy_hosts %}
+ HAProxy_Hosts = {{ haproxy_hosts|join(", ") }};
+{% endif %}
{% if monitoring_addr %}
Monitoring_Addr = {{ monitoring_addr }};
{% endif %}
{% if bind_addr %}
Bind_addr = {{ bind_addr }};
{% endif %}
-{% if haproxy_hosts %}
- HAProxy_Hosts = {{ haproxy_hosts|join(", ") }};
-{% endif %}
{% if enable_rdma and rdma_port %}
NFS_RDMA_Port = {{ rdma_port }};
{% endif %}
{% endif %}
}
{% endif %}
-
%url {{ url }}
ganesha_conf = nfs_generated_conf['files']['ganesha.conf']
assert "Bind_addr = 1.2.3.7" in ganesha_conf
+ @patch("cephadm.serve.CephadmServe._run_cephadm")
+ @patch("cephadm.services.nfs.NFSService.fence_old_ranks", MagicMock())
+ @patch("cephadm.services.nfs.NFSService.run_grace_tool", MagicMock())
+ @patch("cephadm.services.nfs.NFSService.purge", MagicMock())
+ @patch("cephadm.services.nfs.NFSService.create_rados_config_obj", MagicMock())
+ def test_nfs_bind_addr_virtual_ip(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
+ _run_cephadm.side_effect = async_side_effect(('{}', '', 0))
+
+ with with_host(cephadm_module, 'host1', addr='1.2.3.7'):
+ cephadm_module.cache.update_host_networks('host1', {
+ '1.2.3.0/24': {
+ 'if0': ['1.2.3.7']
+ }
+ })
+
+ nfs_spec = NFSServiceSpec(
+ service_id="foo",
+ placement=PlacementSpec(hosts=['host1']),
+ virtual_ip='1.2.3.100',
+ enable_haproxy_protocol=False
+ )
+
+ with with_service(cephadm_module, nfs_spec, status_running=True) as _:
+ dds = wait(cephadm_module, cephadm_module.list_daemons())
+ daemon_spec = CephadmDaemonDeploySpec.from_daemon_description(dds[0])
+
+ nfs_generated_conf, _ = service_registry.get_service('nfs').generate_config(daemon_spec)
+ ganesha_conf = nfs_generated_conf['files']['ganesha.conf']
+
+ assert "Bind_addr = 1.2.3.100" in ganesha_conf
+
@patch("cephadm.serve.CephadmServe._run_cephadm")
def test_ingress_without_haproxy_stats(self, _run_cephadm, cephadm_module: CephadmOrchestrator):
_run_cephadm.side_effect = async_side_effect(('{}', '', 0))