Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2025.1] fix(Azure): enable WaLinuxAgent #10043

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdcm/sct_provision/region_definition_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from sdcm.sct_provision.user_data_objects.scylla import ScyllaUserDataObject
from sdcm.sct_provision.user_data_objects.sshd import SshdUserDataObject
from sdcm.sct_provision.user_data_objects.syslog_ng import SyslogNgUserDataObject, SyslogNgExporterUserDataObject
from sdcm.sct_provision.user_data_objects.walinuxagent import EnableWaLinuxAgent
from sdcm.test_config import TestConfig


Expand Down Expand Up @@ -147,6 +148,7 @@ def _get_user_data_objects(self, instance_name: str, node_type: NodeTypeType) ->
SyslogNgUserDataObject,
SyslogNgExporterUserDataObject,
SshdUserDataObject,
EnableWaLinuxAgent,
ScyllaUserDataObject,
]
user_data_objects = [
Expand Down
37 changes: 37 additions & 0 deletions sdcm/sct_provision/user_data_objects/walinuxagent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright (c) 2025 ScyllaDB
from dataclasses import dataclass
from textwrap import dedent

from sdcm.sct_provision.user_data_objects import SctUserDataObject


@dataclass
class EnableWaLinuxAgent(SctUserDataObject):
"""
Scylla machines on Azure have WaLinuxAgent disabled by default. This script enables it.
https://github.com/scylladb/scylla-machine-image/pull/627
"""
@property
def is_applicable(self) -> bool:
return self.node_type == "scylla-db" and self.params.get("cluster_backend") == "azure"

@property
def script_to_run(self) -> str:
return dedent("""
systemctl daemon-reload
systemctl unmask walinuxagent
systemctl enable walinuxagent
systemctl start walinuxagent
systemctl status walinuxagent --no-pager
""")