Skip to content

Commit

Permalink
Add support to set required cephx auth config
Browse files Browse the repository at this point in the history
Closes: #37
Signed-off-by: Tobias Wolf <[email protected]>
  • Loading branch information
NotTheEvilOne committed May 1, 2024
1 parent edc2fce commit 5324699
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ rook:
image: quay.io/ceph/ceph:v18.2.1

migration_modules:
- cephx_auth_config
- migrate_osds
- migrate_monitors
- example
10 changes: 10 additions & 0 deletions src/rookify/modules/cephx_auth_config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# type: ignore

from .main import CephXAuthHandler

MODULE_NAME = "cephx_auth_config"
HANDLER_CLASS = CephXAuthHandler
REQUIRES = []
AFTER = []
PREFLIGHT_REQUIRES = []
16 changes: 16 additions & 0 deletions src/rookify/modules/cephx_auth_config/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-

from ..module import ModuleHandler
from typing import Any, Dict


class CephXAuthHandler(ModuleHandler):
def run(self) -> Any:
self.logger.debug("Reconfiguring Ceph to expect cephx auth")

self.ceph.conf_set("auth_cluster_required", "cephx")
self.ceph.conf_set("auth_service_required", "cephx")
self.ceph.conf_set("auth_client_required", "cephx")

self.logger.info("Reconfigured Ceph to expect cephx auth")
return { "reconfigured": True }

0 comments on commit 5324699

Please sign in to comment.