Skip to content

Default kafka configuration - #8711

Merged
jrouzierinverse merged 3 commits into
develfrom
feature/default_kafka_configuration
Jul 29, 2025
Merged

Default kafka configuration#8711
jrouzierinverse merged 3 commits into
develfrom
feature/default_kafka_configuration

Conversation

@fdurand

@fdurand fdurand commented Jul 21, 2025

Copy link
Copy Markdown
Member

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

  • Document the feature
  • Add OpenAPI specification
  • Add unit tests
  • Add acceptance tests (TestLink)

NEWS file entries

Enhancements

  • Kafka preconfiguration

This comment was marked as outdated.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's simply to the following

NEW_ADMIN_PASSWORD=$(openssl rand -hex 16)
NEW_CLIENT_PASSWORD=$(openssl rand -hex 16)

@jrouzierinverse
jrouzierinverse requested a review from Copilot July 29, 2025 14:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread addons/upgrade/to-15.0-replace-kafka-values.sh
Comment thread lib/pf/services/manager/kafka.pm
Comment thread lib/pf/services/manager/kafka.pm
NEW_CLIENT_PASSWORD=$(openssl rand -hex 16)

# Update kafka.conf
sed -i.bak \

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@jrouzierinverse
jrouzierinverse merged commit ebab342 into devel Jul 29, 2025
13 checks passed
@fdurand
fdurand deleted the feature/default_kafka_configuration branch February 9, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants