feat(roles/graylog_sidecar): add the Graylog Sidecar roles - #325
Draft
NavidSassan wants to merge 3 commits into
Draft
feat(roles/graylog_sidecar): add the Graylog Sidecar roles#325NavidSassan wants to merge 3 commits into
NavidSassan wants to merge 3 commits into
Conversation
The Graylog Sidecar package repository is versioned and served separately from the main Graylog repository, so it gets its own repo_* role. Custom mirror and basic auth follow the other repo_* roles: credentials are only written when a mirror URL is set.
Installs and configures the Graylog Sidecar log collector agent. Collector backends and configuration assignment stay in the Graylog web UI, matched to the host via graylog_sidecar__tags. Also documents in CONTRIBUTING.md how to template a fully-commented upstream config so that an *.rpmnew stays short and reviewable; the sidecar.yml template is the reference.
Converges without a Graylog server: the sidecar keeps running and retries when the server is unreachable, so the role is fully exercised and the retry attempts in the journal prove the running process picked up the configured server_url. Verifies the systemd unit exists, since the package ships none and it only appears if `graylog-sidecar -service install` really ran.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds two roles for the Graylog Sidecar log collector agent, plus their playbooks
and a Molecule scenario.
Why two roles
The Sidecar is served from its own package repository, versioned independently of
the Graylog server, so
repo_graylog_sidecaris separate fromrepo_graylog.Custom mirror and basic auth follow the other
repo_*roles: credentials are onlywritten when a mirror URL is set.
What the role does not do
Collector backends and the assignment of collector configurations stay in the
Graylog web UI, matched to the host via
graylog_sidecar__tags. What a host shipsis decided on the server, not in this role's variables.
Notes for review
graylog-sidecar -service install, which upstream has been asked to do at packageinstall time since 2018 (Service unit file should be automatically installed Graylog2/collector-sidecar#225, still open). The call is
not idempotent (a second run exits 1 with "Init already exists"), hence the
createsguard. It also enables the unit as a side effect.collector_binaries_accesslistis now explicit. The sidecar executes collectorbinaries as root, chosen by the server, and an empty list disables the check
entirely (
backends/backend.go). The default mirrors the sidecar's own Linuxplatform default, so behaviour is unchanged; the point is that the list is visible
and can be narrowed.
sidecar.ymlis deployed0600. It contains the API token, and the packageitself ships the file
0600.CONTRIBUTING.mdgains a paragraph on templating a fully-commented upstream configso that an
*.rpmnewstays short and reviewable.sidecar.yml.j2is the reference.Testing
molecule test --scenario-name graylog_sidecaragainst a Rocky 10 VM: converge,verify and idempotence all pass. The scenario asserts the package, the generated
systemd unit, the config file mode, the service state, and that the running sidecar
contacts the configured
server_url(from the journal).RHEL 8 and 9 are marked
(x)in COMPATIBILITY.md, untested so far.