Repository navigation
Improve the offline installation prerequisites check and agent next steps - #1254
Conversation
🧪 Unit Tests Results✅ All tests passed! Summary
📊 Coverage Details |
Review of #1254Verdict: changes requested. On a distributed node ( Verified against Blocking: the tar file is read before the missing packages are reported
The component package lists do not depend on the port checks, so both rounds and the report can run together: elif [ -n "${offline_install}" ]; then
offline_checkPrerequisites "wia_offline_dependencies" "${wia_offline_dependencies[@]}"
+ [ -n "${AIO}" ] && offline_checkPrerequisites "AIO"
+ [ -n "${indexer}" ] && offline_checkPrerequisites "indexer"
+ [ -n "${wazuh}" ] && offline_checkPrerequisites "wazuh"
+ [ -n "${dashboard}" ] && offline_checkPrerequisites "dashboard"
+ offline_reportMissingPrerequisites
fiAlso remove the four Non-blocking
Verified, no change needed
|
cbfed2d to
67b514a
Compare
|
Thanks, all three applied in cea3b8f.
Unit tests: 735 passed, 2 skipped. |
- With --offline-installation, collect every missing package across the assistant and component checks and stop once, naming all of them with the command to download them (R238-UX-05). - On RPM-based systems, check what the installed packages provide with rpm -q --whatprovides, so gnupg2 and gnupg2-minimal count as gnupg and the check does not go through the yum repositories. - In the installation summary, say which line of the enrollment token command is the token; offline, tell to install the agent package copied to the endpoint with the token instead of Deploy new agent, and link the offline guide (R238-UX-02). Refs #1253
Explain in the offline installation assistant guide that the content shipped with the Wazuh indexer keeps loading after the installation, that an offline update request is answered with 409 until it ends, and link the offline content update procedure (R238-UX-04). Refs #1253
…ting Testing on real hosts without Internet access showed that: - Through a pipe or a file, the token printed by --create-enrollment-token comes after its details, so it is not "the first line". The summary now gives the command with 2>/dev/null, which prints only the token. - The agent installed with a token does not start by itself: add systemctl enable --now wazuh-agent to the offline next steps, and say to copy GPG-KEY-WAZUH with an RPM package. - apt-get download and yumdownloader --resolve of the missing packages alone are not enough: they leave out dependencies the target lacks or has in an older version. Suggest downloading the dependencies too (apt-cache depends --recurse, dnf download --resolve --alldeps) on a host with the same operating system and architecture, and installing them with dpkg -i or dnf install --disablerepo='*' --skip-broken. Refs #1253
On a distributed node, checks_previousCertificate reads wazuh-install-files.tar with tar before the component packages were checked, so a node without tar stopped with "There is no config.yml" instead of the list of missing packages. Check the packages of every component and report them right after the assistant's own packages. Also say in the summary what to do when the token command prints nothing (its errors go to standard error), and give the content load time measured in the tests. Refs #1253
67b514a to
cea3b8f
Compare
Description
Closes #1253
The Experience Quality team followed the 5.0.0 offline installation pages with the installation assistant (report R238 in wazuh/external-devel-requests#6948). This PR fixes R238-UX-02 and R238-UX-05, documents the part of R238-UX-04 that belongs to the installation assistant, and leaves R238-UX-03 out. The reasons are below.
R238-UX-05, missing packages one at a time:
--offline-installationchecked the operating system packages in two rounds (the assistant's, then the component's) and stopped at the first missing one.offline_checkPrerequisitesnow collects every missing package from both rounds, andoffline_reportMissingPrerequisitesstops once with the full list and the commands to download them with their dependencies and to install them:On RPM-based systems the commands are
dnf download --resolve --alldeps --arch <arch> --arch noarch ...anddnf install --disablerepo='*' --skip-broken ./*.rpm. The packages alone (apt-get download,yumdownloader --resolve) were not enough in testing: they leave out the dependencies the target lacks or has in an older version.RPM,
gnupgreported missing: the check compared package names, sognupgwas always missing on RHEL (gnupg2) and Amazon Linux 2023 (gnupg2-minimal). It now usesrpm -q --whatprovides, which also skips the yum repositories, which time out without Internet access.R238-UX-02, next steps after an offline installation: the summary sent users to Deploy new agent, whose commands download the agent. With
--offline-installationit now tells to copy the agent package (andGPG-KEY-WAZUHfor an RPM package) to the endpoint, install it with the token and start the agent, and links the offline guide. Online and offline, the token command ends with2>/dev/null: the token goes to standard output and its details to standard error, and through a pipe or a file the token comes after its details, so taking "the first line" picks a detail and the agent does not enroll.R238-UX-04, content updates:
offline-assisted-install.mdnow explains that the content shipped with the Wazuh indexer keeps loading after the installation, that an offline update is answered with409until then, and links the Indexer's offline content update procedure.--download-content/--update-contentare not added: they would follow internals of the content manager and of the Wazuh manager that are not a versioned interface.R238-UX-03, agent packages in
-dw: not implemented. The installation assistant installs the central components, not endpoints. Downloading and checking agent packages for every platform would make it own packages it never installs. The offline summary says to copy the agent package and links the offline guide.Docs: sample output of the summary in the offline, all-in-one and clusterized guides;
offline-download-packages.mdnames thelibcap2-bin/libcappackage instead of thesetcapcommand and explains how to download and install missing packages.Tests
Unit tests
The new and changed tests fail on
5.0.0without this change, and pass with it:Offline installation on hosts without Internet access
wazuh-install.shbuilt from this branch, 5.0.0-rc2 packages (-d localwith the rc2artifact_urlsfile), AWS instances with outgoing traffic blocked with iptables (curltopackages.wazuh.comfails).-dwon a host with Internet accesswazuh-offline.tar.gzin 57 scurl iproute2 libcap2-bintar iproutegnupgnot reported missing withgnupg2installed"status": "active"on the managerrpm -Kof the agent package with the bundled key:digests signatures OK409 A content update is already in progress.for about 7 minutes (4 vCPU, 8 GB)The first round of this test found the three problems fixed in 124cef4: the token is not the first line through a pipe, the agent does not start by itself, and the packages alone are not enough. The download and install commands of 124cef4 were then checked in containers without network: Ubuntu 24.04 with
curl,iproute2andlibcap2-binmissing (50 packages downloaded,dpkg -iexit 0), and Rocky 9 withtarandiprouteremoved (29 packages,dnf install --skip-brokeninstalledtar,iproute,libbpfandpsmisc). The built installer prints the new error on both.