[COMMIT scylla-cluster-tests master] fix(sdcm/*): integrate scylla yaml

0 views
Skip to first unread message

Commit Bot

unread,
Sep 28, 2021, 8:11:01 AMSep 28
to scylla...@googlegroups.com, Dmitry Kropachev
From: Dmitry Kropachev <dmitry.k...@gmail.com>
Committer: Bentsi <ben...@scylladb.com>
Branch: master

fix(sdcm/*): integrate scylla yaml

---
diff --git a/artifacts_test.py b/artifacts_test.py
--- a/artifacts_test.py
+++ b/artifacts_test.py
@@ -36,7 +36,7 @@ def node(self):

def check_cluster_name(self):
with self.node.remote_scylla_yaml() as scylla_yaml:
- yaml_cluster_name = scylla_yaml.get('cluster_name', '')
+ yaml_cluster_name = scylla_yaml.cluster_name

self.assertTrue(self.db_cluster.name == yaml_cluster_name,
f"Cluster name is not as expected. Cluster name in scylla.yaml: {yaml_cluster_name}. "
@@ -94,7 +94,7 @@ def verify_snitch(self, backend_name: str):

describecluster_snitch = self.get_describecluster_info().snitch
with self.node.remote_scylla_yaml() as scylla_yaml:
- scylla_yaml_snitch = scylla_yaml['endpoint_snitch']
+ scylla_yaml_snitch = scylla_yaml.endpoint_snitch
expected_snitches = BACKENDS[backend_name]

snitch_patterns = [re.compile(f"({snitch})") for snitch in expected_snitches]
diff --git a/functional_tests/scylla_operator/test_functional.py b/functional_tests/scylla_operator/test_functional.py
--- a/functional_tests/scylla_operator/test_functional.py
+++ b/functional_tests/scylla_operator/test_functional.py
@@ -151,7 +151,7 @@ def test_listen_address(db_cluster):
continue
# If no --listen-address in command line then proceed with scylla.yaml
with node.actual_scylla_yaml() as scylla_yaml:
- listen_address = scylla_yaml.get('listen_address')
+ listen_address = scylla_yaml.listen_address
if not listen_address:
all_errors.append(f"Not found listen_address flag in the {node.name} scylla.yaml")
elif listen_address != '0.0.0.0':
diff --git a/sdcm/cluster.py b/sdcm/cluster.py
--- a/sdcm/cluster.py
+++ b/sdcm/cluster.py
@@ -12,7 +12,7 @@
# Copyright (c) 2016 ScyllaDB

# pylint: disable=too-many-lines
-
+import contextlib
import queue
import getpass
import logging
@@ -27,7 +27,7 @@
import itertools
import json
import ipaddress
-from typing import List, Optional, Dict, Union, Set, Iterable
+from typing import List, Optional, Dict, Union, Set, Iterable, ContextManager
from datetime import datetime
from textwrap import dedent
from functools import cached_property, wraps
@@ -52,11 +52,17 @@
from sdcm.mgmt.common import get_manager_repo_from_defaults, get_manager_scylla_backend
from sdcm.prometheus import start_metrics_server, PrometheusAlertManagerListener, AlertSilencer
from sdcm.log import SDCMAdapter
+from sdcm.provision.scylla_yaml import ScyllaYamlNodeAttrBuilder
+from sdcm.provision.scylla_yaml.certificate_builder import ScyllaYamlCertificateAttrBuilder
+
+from sdcm.provision.scylla_yaml.cluster_builder import ScyllaYamlClusterAttrBuilder
+from sdcm.provision.scylla_yaml.scylla_yaml import ScyllaYaml
+from sdcm.provision.helpers.certificate import install_client_certificate, install_encryption_at_rest_files
from sdcm.remote import RemoteCmdRunnerBase, LOCALRUNNER, NETWORK_EXCEPTIONS, shell_script_cmd
from sdcm.remote.remote_file import remote_file, yaml_file_to_dict, dict_to_yaml_file
from sdcm import wait, mgmt
from sdcm.sct_events.continuous_event import ContinuousEventsRegistry
-from sdcm.utils import alternator, properties
+from sdcm.utils import properties
from sdcm.utils.common import (
S3Storage,
ScyllaCQLSession,
@@ -309,6 +315,32 @@ def host_id(self):
return full_nodetool_status[data_center][self.ip_address]['host_id']
raise AssertionError(f"Could not find the requested node {self.ip_address} in nodetool status")

+ @property
+ def _proposed_scylla_yaml_properties(self) -> dict:
+ node_params_builder = ScyllaYamlNodeAttrBuilder(params=self.parent_cluster.params, node=self)
+ certificate_params_builder = ScyllaYamlCertificateAttrBuilder(params=self.parent_cluster.params, node=self)
+ return node_params_builder.dict(exclude_none=True) | certificate_params_builder.dict(exclude_none=True)
+
+ @property
+ def proposed_scylla_yaml(self) -> ScyllaYaml:
+ """
+ A scylla yaml that is suggested for the node, it is calculated of the SCTConfiguration,
+ and BaseNode entity is providing ip addresses
+ """
+ scylla_yml = ScyllaYaml(**self._proposed_scylla_yaml_properties)
+ if self.enable_auto_bootstrap is not None:
+ scylla_yml.auto_bootstrap = self.enable_auto_bootstrap
+ if self.replacement_node_ip:
+ scylla_yml.replace_address_first_boot = self.replacement_node_ip
+ if append_scylla_yaml := self.parent_cluster.params.get('append_scylla_yaml'):
+ append_scylla_yaml = yaml.safe_load(append_scylla_yaml)
+ if any(substr in append_scylla_yaml for substr in (
+ "system_key_directory", "system_info_encryption", "kmip_hosts")):
+ install_encryption_at_rest_files(self.remoter)
+ scylla_yml.update(append_scylla_yaml)
+
+ return scylla_yml
+
def refresh_ip_address(self):
# Invalidate ip address cache
self._private_ip_address_cached = self._public_ip_address_cached = self._ipv6_ip_address_cached = None
@@ -1568,8 +1600,13 @@ def _remote_properties(self, path):
def remote_cassandra_rackdc_properties(self):
return self._remote_properties(path=self.add_install_prefix(abs_path=SCYLLA_PROPERTIES_PATH))

- def remote_scylla_yaml(self):
- return self._remote_yaml(path=self.add_install_prefix(abs_path=SCYLLA_YAML_PATH))
+ @contextlib.contextmanager
+ def remote_scylla_yaml(self) -> ContextManager[ScyllaYaml]:
+ with self._remote_yaml(path=self.add_install_prefix(abs_path=SCYLLA_YAML_PATH)) as scylla_yaml:
+ scylla_yaml_object = ScyllaYaml(**scylla_yaml)
+ yield scylla_yaml_object
+ scylla_yaml.clear()
+ scylla_yaml.update(scylla_yaml_object.dict(exclude_defaults=True, exclude_unset=True))

def remote_manager_yaml(self):
return self._remote_yaml(path=SCYLLA_MANAGER_YAML_PATH)
@@ -1652,151 +1689,18 @@ def create_ldap_users_on_scylla(self):
if orig_auth:
update_authenticator([self], orig_auth)

- # pylint: disable=invalid-name,too-many-arguments,too-many-locals,too-many-branches,too-many-statements
+ # pylint: disable=invalid-name,too-many-arguments,too-many-locals,too-many-statements,unused-argument,too-many-branches
def config_setup(self,
- seed_address=None,
- cluster_name=None,
- enable_exp=True,
- endpoint_snitch=None,
- broadcast=None,
- authenticator=None,
- server_encrypt=None,
- client_encrypt=None,
- append_scylla_yaml=None,
append_scylla_args='',
debug_install=False,
- hinted_handoff="enabled",
- murmur3_partitioner_ignore_msb_bits=None,
- authorizer=None,
- alternator_port=None,
- listen_on_all_interfaces=False,
- ip_ssh_connections=None,
- alternator_enforce_authorization=False,
- internode_compression=None,
- internode_encryption=None,
- ldap=False,
- ms_ad_ldap=False):
+ **_
+ ):
with self.remote_scylla_yaml() as scylla_yml:
- if seed_address:
- # Set seeds
- scylla_yml['seed_provider'] = [
- dict(class_name='org.apache.cassandra.locator.SimpleSeedProvider',
- parameters=[dict(seeds=seed_address)])]
-
- # NOTICE: the following configuration always have to use private_ip_address for multi-region to work
- # Set listen_address
- scylla_yml['listen_address'] = self.private_ip_address
- # Set rpc_address
- scylla_yml['rpc_address'] = self.private_ip_address
-
- if listen_on_all_interfaces:
- # Set listen_address
- scylla_yml['listen_address'] = "0.0.0.0"
- # Set rpc_address
- scylla_yml['rpc_address'] = "0.0.0.0"
-
- if broadcast:
- # Set broadcast_address
- scylla_yml['broadcast_address'] = broadcast
-
- # Set broadcast_rpc_address
- scylla_yml['broadcast_rpc_address'] = broadcast
-
- if cluster_name:
- scylla_yml['cluster_name'] = cluster_name
-
- # disable hinted handoff (it is enabled by default in Scylla). Expected values: "enabled"/"disabled"
- if hinted_handoff == 'disabled':
- scylla_yml['hinted_handoff_enabled'] = False
-
- if ip_ssh_connections == 'ipv6':
- self.log.debug('Enable IPv6 DNS lookup')
- scylla_yml['enable_ipv6_dns_lookup'] = True
-
- scylla_yml['prometheus_address'] = self.ip_address
- scylla_yml['broadcast_rpc_address'] = self.ip_address
- scylla_yml['listen_address'] = self.ip_address
- scylla_yml['rpc_address'] = self.ip_address
-
- if murmur3_partitioner_ignore_msb_bits:
- self.log.debug('Change murmur3_partitioner_ignore_msb_bits to {}'.format(
- murmur3_partitioner_ignore_msb_bits))
- scylla_yml['murmur3_partitioner_ignore_msb_bits'] = int(murmur3_partitioner_ignore_msb_bits)
-
- if enable_exp:
- scylla_yml['experimental'] = True
-
- if endpoint_snitch:
- scylla_yml['endpoint_snitch'] = endpoint_snitch
-
- if not client_encrypt:
- scylla_yml['client_encryption_options'] = dict(enabled=False)
-
- if self.enable_auto_bootstrap:
- scylla_yml['auto_bootstrap'] = True
- else:
- if 'auto_bootstrap' in scylla_yml:
- scylla_yml['auto_bootstrap'] = False
-
- if authenticator in ['AllowAllAuthenticator', 'PasswordAuthenticator', SASLAUTHD_AUTHENTICATOR]:
- scylla_yml['authenticator'] = authenticator
- scylla_yml['saslauthd_socket_path'] = '/run/saslauthd/mux'
-
- if authorizer in ['AllowAllAuthorizer', 'CassandraAuthorizer']:
- scylla_yml['authorizer'] = authorizer
-
- if server_encrypt or client_encrypt:
- self.config_client_encrypt()
- if server_encrypt:
- scylla_yml['server_encryption_options'] = dict(internode_encryption=internode_encryption,
- certificate='/etc/scylla/ssl_conf/db.crt',
- keyfile='/etc/scylla/ssl_conf/db.key',
- truststore='/etc/scylla/ssl_conf/cadb.pem')
-
- if client_encrypt:
- scylla_yml['client_encryption_options'] = dict(enabled=True,
- certificate='/etc/scylla/ssl_conf/client/test.crt',
- keyfile='/etc/scylla/ssl_conf/client/test.key',
- truststore='/etc/scylla/ssl_conf/client/catest.pem')
-
- if self.replacement_node_ip:
- scylla_yml['replace_address_first_boot'] = self.replacement_node_ip
- else:
- if 'replace_address_first_boot' in scylla_yml:
- del scylla_yml['replace_address_first_boot']
-
- if alternator_port:
- scylla_yml['alternator_port'] = alternator_port
- scylla_yml['alternator_write_isolation'] = alternator.enums.WriteIsolation.ALWAYS_USE_LWT.value
-
- if alternator_enforce_authorization:
- scylla_yml['alternator_enforce_authorization'] = True
- else:
- scylla_yml['alternator_enforce_authorization'] = False
-
- if internode_compression:
- scylla_yml['internode_compression'] = internode_compression
-
- if ldap and ms_ad_ldap:
- scylla_yml.update(self.get_ldap_ms_ad_config())
- elif ldap:
- scylla_yml.update(self.get_openldap_config())
-
- if append_scylla_yaml:
- scylla_yml.update(yaml.safe_load(append_scylla_yaml))
-
- if append_scylla_yaml:
- if any(substr in append_scylla_yaml for substr in ("system_key_directory",
- "system_info_encryption",
- "kmip_hosts:", )):
- self.remoter.send_files(src="./data_dir/encrypt_conf", dst="/tmp/")
- self.remoter.sudo(shell_script_cmd("""\
- rm -rf /etc/encrypt_conf
- mv -f /tmp/encrypt_conf /etc
- mkdir -p /etc/scylla/encrypt_conf /etc/encrypt_conf/system_key_dir
- chown -R scylla:scylla /etc/scylla /etc/encrypt_conf
- """))
- self.remoter.sudo("md5sum /etc/encrypt_conf/*.pem", ignore_status=True)
+ scylla_yml.update(
+ self.parent_cluster.proposed_scylla_yaml,
+ self.proposed_scylla_yaml
+ )
+ self.log.debug('SCYLLA_YAML: ' + str(scylla_yml))

self.process_scylla_args(append_scylla_args)

@@ -1848,15 +1752,7 @@ def process_scylla_args(self, append_scylla_args=''):
f"{self.scylla_server_sysconfig_path}")

def config_client_encrypt(self):
- self.remoter.send_files(src='./data_dir/ssl_conf', dst='/tmp/') # pylint: disable=not-callable
- setup_script = dedent("""
- mkdir -p ~/.cassandra/
- cp /tmp/ssl_conf/client/cqlshrc ~/.cassandra/
- sudo mkdir -p /etc/scylla/
- sudo rm -rf /etc/scylla/ssl_conf/
- sudo mv -f /tmp/ssl_conf/ /etc/scylla/
- """)
- self.remoter.run('bash -cxe "%s"' % setup_script)
+ install_client_certificate(self.remoter)

@retrying(n=3, sleep_time=10, allowed_exceptions=(AssertionError,), message="Retrying on getting scylla repo")
def download_scylla_repo(self, scylla_repo):
@@ -2396,6 +2292,7 @@ def upgrade_mgmt(self, scylla_mgmt_address, start_manager_after_upgrade=True):
self.remoter.sudo("systemctl restart scylla-manager.service")
time.sleep(5)

+ # pylint: disable=too-many-branches
def install_mgmt(self, package_url: Optional[str] = None) -> None:
self.log.debug("Install scylla-manager")

@@ -2685,7 +2582,7 @@ def _restart_node_with_resharding(self, murmur3_partitioner_ignore_msb_bits: int
self.stop_scylla()
# Change murmur3_partitioner_ignore_msb_bits parameter to cause resharding.
with self.remote_scylla_yaml() as scylla_yml:
- scylla_yml["murmur3_partitioner_ignore_msb_bits"] = murmur3_partitioner_ignore_msb_bits
+ scylla_yml.murmur3_partitioner_ignore_msb_bits = murmur3_partitioner_ignore_msb_bits
search_reshard = self.follow_system_log(patterns=['Reshard', 'Reshap'])
self.start_scylla(timeout=7200)
return search_reshard
@@ -3667,6 +3564,19 @@ def get_scylla_args(self):
def get_rack_nodes(self, rack: int) -> list:
return sorted([node for node in self.nodes if node.rack == rack], key=lambda n: n.name)

+ @cached_property
+ def proposed_scylla_yaml(self) -> ScyllaYaml:
+ """
+ A scylla yaml that cluster imposes on nodes, it is calculated of the SCTConfiguration,
+ and TestConfig is providing LDAP-related information
+ """
+ cluster_params_builder = ScyllaYamlClusterAttrBuilder(
+ params=self.params,
+ test_config=self.test_config,
+ msldap_server_info=KeyStore().get_ldap_ms_ad_credentials()
+ )
+ return ScyllaYaml(**cluster_params_builder.dict(exclude_unset=True, exclude_none=True))
+
@property
def racks(self) -> Set[int]:
return {node.rack for node in self.nodes}
@@ -3874,15 +3784,9 @@ def start_scylla(node, _queue):
self.log.debug('Update DB packages duration -> %s s', int(time_elapsed))

def update_seed_provider(self):
- seed_provider = [{
- "class_name": "org.apache.cassandra.locator.SimpleSeedProvider",
- "parameters": [{
- "seeds": ",".join(self.seed_nodes_ips),
- }, ],
- }, ]
for node in self.nodes:
with node.remote_scylla_yaml() as scylla_yml:
- scylla_yml["seed_provider"] = seed_provider
+ scylla_yml.seed_provider = node.proposed_scylla_yaml.seed_provider

def update_db_binary(self, node_list=None, start_service=True):
if node_list is None:
diff --git a/sdcm/cluster_aws.py b/sdcm/cluster_aws.py
--- a/sdcm/cluster_aws.py
+++ b/sdcm/cluster_aws.py
@@ -36,6 +36,7 @@
from botocore.exceptions import WaiterError

from sdcm import ec2_client, cluster
+from sdcm.provision.scylla_yaml import SeedProvider
from sdcm.remote import LocalCmdRunner, shell_script_cmd, NETWORK_EXCEPTIONS
from sdcm.ec2_client import CreateSpotInstancesError
from sdcm.utils.aws_utils import tags_as_ec2_tags, ec2_instance_wait_public_ip
@@ -686,16 +687,13 @@ def restart(self):
other_nodes = list(set(self.parent_cluster.nodes) - {self})
free_nodes = [node for node in other_nodes if not node.running_nemesis]
random_node = random.choice(free_nodes)
-
- seed_provider = [{
- "class_name": "org.apache.cassandra.locator.SimpleSeedProvider",
- "parameters": [{
- "seeds": f"{random_node.ip_address}"
- }, ],
- }, ]
+ seed_provider = SeedProvider(
+ class_name="org.apache.cassandra.locator.SimpleSeedProvider",
+ parameters=[{"seeds": f"{random_node.ip_address}"}]
+ )

with self.remote_scylla_yaml() as scylla_yml:
- scylla_yml["seed_provider"] = seed_provider
+ scylla_yml.seed_provider = [seed_provider]

with ExitStack() as stack:
if self.is_data_device_lost_after_reboot:
diff --git a/sdcm/cluster_k8s/__init__.py b/sdcm/cluster_k8s/__init__.py
--- a/sdcm/cluster_k8s/__init__.py
+++ b/sdcm/cluster_k8s/__init__.py
@@ -40,12 +40,13 @@

import yaml
import kubernetes as k8s
-from kubernetes.client import V1Container, V1ResourceRequirements, V1ConfigMap
+from kubernetes.client import V1ConfigMap
from kubernetes.dynamic.resource import Resource, ResourceField, ResourceInstance, ResourceList, Subresource
from invoke.exceptions import CommandTimedOut

from sdcm import sct_abs_path, cluster, cluster_docker
from sdcm.cluster import DeadNode, ClusterNodesNotReady
+from sdcm.provision.scylla_yaml.scylla_yaml import ScyllaYaml
from sdcm.test_config import TestConfig
from sdcm.db_stats import PrometheusDBStats
from sdcm.remote import NETWORK_EXCEPTIONS
@@ -78,7 +79,6 @@
from sdcm.utils.decorators import timeout as timeout_wrapper
from sdcm.utils.remote_logger import get_system_logging_thread, CertManagerLogger, ScyllaOperatorLogger, \
KubectlClusterEventsLogger, ScyllaManagerLogger, KubernetesWrongSchedulingLogger
-from sdcm.utils.version_utils import get_git_tag_from_helm_chart_version
from sdcm.wait import wait_for
from sdcm.cluster_k8s.operator_monitoring import ScyllaOperatorLogMonitoring

@@ -1619,11 +1619,11 @@ def restart(self):

parent_cluster: ScyllaPodCluster

- def actual_scylla_yaml(self):
+ def actual_scylla_yaml(self) -> ContextManager[ScyllaYaml]:
return super().remote_scylla_yaml()

@contextlib.contextmanager
- def remote_scylla_yaml(self) -> ContextManager:
+ def remote_scylla_yaml(self) -> ContextManager[ScyllaYaml]:
"""Update scylla.yaml, k8s way

Scylla Operator handles scylla.yaml updates using ConfigMap resource and we don't need to update it
@@ -1635,13 +1635,13 @@ def remote_scylla_yaml(self) -> ContextManager:
"""
with self.parent_cluster.scylla_yaml_lock:
# TBD: Interfere with remote_cassandra_rackdc_properties, needed to be addressed
- scylla_yaml_copy = deepcopy(self.parent_cluster.scylla_yaml)
+ scylla_yaml_copy = self.parent_cluster.scylla_yaml.copy()
yield self.parent_cluster.scylla_yaml
if scylla_yaml_copy == self.parent_cluster.scylla_yaml:
LOGGER.debug("%s: scylla.yaml hasn't been changed", self)
return
- original = yaml.safe_dump(scylla_yaml_copy).splitlines(keepends=True)
- changed = yaml.safe_dump(self.parent_cluster.scylla_yaml).splitlines(keepends=True)
+ original = yaml.safe_dump(scylla_yaml_copy.as_dict()).splitlines(keepends=True)
+ changed = yaml.safe_dump(self.parent_cluster.scylla_yaml.as_dict()).splitlines(keepends=True)
diff = "".join(unified_diff(original, changed))
LOGGER.debug("%s: scylla.yaml requires to be updated with:\n%s", self, diff)
self.parent_cluster.scylla_yaml_update_required = True
@@ -1946,7 +1946,7 @@ def __init__(self,
node_prepare_config=self.NODE_PREPARE_FILE
)
self.scylla_yaml_lock = RLock()
- self.scylla_yaml = {}
+ self.scylla_yaml = ScyllaYaml()
self.scylla_yaml_update_required = False
self.scylla_cluster_name = scylla_cluster_name
super().__init__(k8s_cluster=k8s_cluster,
@@ -2288,7 +2288,7 @@ def wait_till_any_node_get_new_image(nodes_with_old_image: list):
def update_scylla_config(self):
with self.scylla_yaml_lock:
with NamedTemporaryFile("w", delete=False) as tmp:
- tmp.write(yaml.safe_dump(self.scylla_yaml))
+ tmp.write(yaml.safe_dump(self.scylla_yaml.as_dict()))
tmp.flush()
self.k8s_cluster.kubectl_multi_cmd(
f'kubectl create configmap {SCYLLA_CONFIG_NAME} --from-file=scylla.yaml={tmp.name} ||'
diff --git a/sdcm/nemesis.py b/sdcm/nemesis.py
--- a/sdcm/nemesis.py
+++ b/sdcm/nemesis.py
@@ -534,7 +534,7 @@ def disrupt_switch_between_password_authenticator_and_saslauthd_authenticator_an
raise UnsupportedNemesis("SaslauthdAuthenticator is only supported by Scylla Enterprise")

with self.target_node.remote_scylla_yaml() as scylla_yml:
- orig_auth = scylla_yml.get('authenticator')
+ orig_auth = scylla_yml.authenticator
if orig_auth == SASLAUTHD_AUTHENTICATOR:
opposite_auth = 'PasswordAuthenticator'
elif orig_auth == 'PasswordAuthenticator':
@@ -562,14 +562,13 @@ def get_internode_compression_new_value_randomly(current_compression):
values_to_toggle = list(filter(lambda value: value != current_compression, values))
return random.choice(values_to_toggle)

- key = 'internode_compression'
with self.target_node.remote_scylla_yaml() as scylla_yaml:
- current = scylla_yaml.get(key, 'dummy_value_no_internode_compression_key_and_value')
+ current = scylla_yaml.internode_compression
new_value = get_internode_compression_new_value_randomly(current)
for node in self.cluster.nodes:
self.log.debug(f"Changing {node} inter node compression to {new_value}")
with node.remote_scylla_yaml() as scylla_yaml:
- scylla_yaml[key] = new_value
+ scylla_yaml.internode_compression = new_value
self.log.info(f"Restarting node {node}")
node.restart_scylla_server()

@@ -723,7 +722,8 @@ def destroy_ldap_container():
def remove_ldap_configuration_from_node(node):
with node.remote_scylla_yaml() as scylla_yaml:
for key in ldap_config:
- ldap_config[key] = scylla_yaml.pop(key)
+ ldap_config[key] = getattr(scylla_yaml, key)
+ setattr(scylla_yaml, key, None)
node.restart_scylla_server()

if not ContainerManager.is_running(self.tester.localhost, 'ldap'):
diff --git a/sdcm/utils/common.py b/sdcm/utils/common.py
--- a/sdcm/utils/common.py
+++ b/sdcm/utils/common.py
@@ -2294,7 +2294,7 @@ def update_authenticator(nodes, authenticator='AllowAllAuthenticator', restart=T
"""
for node in nodes:
with node.remote_scylla_yaml() as scylla_yml:
- scylla_yml['authenticator'] = authenticator
+ scylla_yml.authenticator = authenticator
if restart:
if authenticator == SASLAUTHD_AUTHENTICATOR:
node.run_cqlsh(f'ALTER ROLE \'{LDAP_USERS[0]}\' with password=\'{LDAP_PASSWORD}\'')
@@ -2334,7 +2334,7 @@ def prepare_and_start_saslauthd_service(node):
for key in conf.keys():
node.remoter.run(f'echo "{key}: {conf[key]}" | sudo tee -a /etc/saslauthd.conf')
with node.remote_scylla_yaml() as scylla_yml:
- scylla_yml['saslauthd_socket_path'] = '/run/saslauthd/mux'
+ scylla_yml.saslauthd_socket_path = '/run/saslauthd/mux'
node.remoter.sudo('systemctl restart saslauthd')


Reply all
Reply to author
Forward
0 new messages