]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: move keepalived sysctl settings
authorMichael Fritch <mfritch@suse.com>
Mon, 10 May 2021 19:36:20 +0000 (13:36 -0600)
committerMichael Fritch <mfritch@suse.com>
Wed, 12 May 2021 23:59:14 +0000 (17:59 -0600)
from container pre-start to sysctl file

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index e3ee3ac79e502d3485bbbfaad1996b927935ceaa..a9f3d9a6c32a2a2a19e1f4aa20abb6b3194ab217 100755 (executable)
@@ -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: