From: Michael Fritch Date: Mon, 10 May 2021 19:36:20 +0000 (-0600) Subject: cephadm: move keepalived sysctl settings X-Git-Tag: v17.1.0~1901^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=04127a0d2226c0499af53503a936134aa744a2b3;p=ceph.git cephadm: move keepalived sysctl settings from container pre-start to sysctl file Signed-off-by: Michael Fritch --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index e3ee3ac79e50..a9f3d9a6c32a 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -825,12 +825,12 @@ class Keepalived(object): return envs @staticmethod - def get_prestart(): - return ( - '# keepalived needs IP forwarding and non-local bind\n' - 'sysctl net.ipv4.ip_forward=1\n' - 'sysctl net.ipv4.ip_nonlocal_bind=1\n' - ) + def get_sysctl_settings() -> List[str]: + return [ + '# IP forwarding and non-local bind', + 'net.ipv4.ip_forward = 1', + 'net.ipv4.ip_nonlocal_bind = 1', + ] def extract_uid_gid_keepalived(self): # better directory for this? @@ -2742,8 +2742,6 @@ def deploy_daemon_units( ceph_iscsi = CephIscsi.init(ctx, fsid, daemon_id) tcmu_container = ceph_iscsi.get_tcmu_runner_container() _write_container_cmd_to_bash(ctx, f, tcmu_container, 'iscsi tcmu-runnter container', background=True) - elif daemon_type == Keepalived.daemon_type: - f.write(Keepalived.get_prestart()) _write_container_cmd_to_bash(ctx, f, c, '%s.%s' % (daemon_type, str(daemon_id))) @@ -2971,6 +2969,8 @@ def install_sysctl(ctx: CephadmContext, fsid: str, daemon_type: str) -> None: if daemon_type == 'osd': lines = OSD.get_sysctl_settings() + elif daemon_type == 'keepalived': + lines = Keepalived.get_sysctl_settings() # apply the sysctl settings if lines: