Default kafka configuration - #8711
Merged
Merged
Conversation
jrouzierinverse
requested changes
Jul 28, 2025
Comment on lines
+13
to
+14
| NEW_ADMIN_PASSWORD=$(openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | head -c 12) | ||
| NEW_CLIENT_PASSWORD=$(openssl rand -base64 12 | tr -dc 'a-zA-Z0-9' | head -c 12) |
Member
There was a problem hiding this comment.
Let's simply to the following
NEW_ADMIN_PASSWORD=$(openssl rand -hex 16)
NEW_CLIENT_PASSWORD=$(openssl rand -hex 16)
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds default Kafka configuration to enable Kafka to start by default without manual configuration. The changes provide pre-configured settings and placeholders that are automatically populated during installation/upgrade.
- Adds a default Kafka configuration template with placeholder values for management IP, passwords, and UUID
- Creates an upgrade script to generate and replace placeholder values with actual configuration
- Updates service manager to handle the new default configuration pattern
- Sets default Kafka broker endpoints in related configuration files
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
conf/kafka.conf.example |
Converts from commented example to active template with placeholder values |
addons/upgrade/to-15.0-replace-kafka-values.sh |
New script to generate UUID and passwords, replacing placeholders in kafka.conf |
lib/pf/services/manager/kafka.pm |
Updates to handle placeholder hostname pattern and management IP substitution |
rpm/packetfence.spec |
Adds upgrade script execution during RPM installation |
debian/packetfence.postinst |
Adds upgrade script execution during Debian package installation |
conf/pfcron.conf.defaults |
Sets default Kafka broker endpoint |
addons/perl-client/conf/fingerbank.conf.defaults |
Configures Kafka-related environment variables |
| NEW_CLIENT_PASSWORD=$(openssl rand -hex 16) | ||
|
|
||
| # Update kafka.conf | ||
| sed -i.bak \ |
There was a problem hiding this comment.
The script should verify that the sed operation was successful before continuing. Consider adding error checking after the sed command to ensure the file was properly updated.
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.
Description
Added a default kafka configuration file to allow kafka to be able to start by default.
Impacts
Kafka
Delete branch after merge
YES
Checklist
NEWS file entries
Enhancements