feat: add CentOS Stream support to deployment and maintenance scripts
This commit is contained in:
+6
-5
@@ -2,7 +2,7 @@
|
||||
# Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
"""Idempotent server setup for Fedora Server and openEuler.
|
||||
"""Idempotent server setup for Fedora Server, CentOS Stream and openEuler.
|
||||
|
||||
No external dependencies — stdlib and system tools only. Every operation
|
||||
checks current state before acting; running the script repeatedly produces
|
||||
@@ -38,7 +38,7 @@ GREEN = "\033[32m"
|
||||
YELLOW = "\033[33m"
|
||||
DIM = "\033[2m"
|
||||
RESET = "\033[0m"
|
||||
VERSION = "1.2.0"
|
||||
VERSION = "1.3.0"
|
||||
|
||||
# Timeout in seconds for dnf operations — metadata downloads and package
|
||||
# transactions on a fresh or slow system routinely exceed the 60 s default
|
||||
@@ -48,6 +48,7 @@ DNF_TIMEOUT = 1800
|
||||
# Map os-release ID to display name — only these two are supported.
|
||||
SUPPORTED_OS: dict[str, str] = {
|
||||
"fedora": "Fedora",
|
||||
"centos": "CentOS Stream",
|
||||
"openeuler": "openEuler",
|
||||
}
|
||||
|
||||
@@ -850,9 +851,9 @@ def setup_auto_updates(os_id: str, dry_run: bool = False) -> dict[str, Any]:
|
||||
"failed": False,
|
||||
}
|
||||
|
||||
if os_id == "fedora":
|
||||
if os_id in ("fedora", "centos"):
|
||||
# --- Install dnf-automatic (dnf4 name; provided virtually on dnf5) ---
|
||||
_status("Checking dnf-automatic (Fedora)")
|
||||
_status("Checking dnf-automatic (Fedora / CentOS Stream)")
|
||||
pkg_present = _rpm_installed("dnf-automatic") or _rpm_installed("dnf5-plugin-automatic")
|
||||
if not pkg_present:
|
||||
_status_done("not installed")
|
||||
@@ -1221,7 +1222,7 @@ def print_summary(
|
||||
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
||||
"""Parse command-line arguments."""
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Idempotent server setup for Fedora Server and openEuler",
|
||||
description="Idempotent server setup for Fedora Server, CentOS Stream and openEuler",
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter,
|
||||
)
|
||||
parser.add_argument(
|
||||
|
||||
Reference in New Issue
Block a user