Skip to content

ironic.conf.j2: Allow configuring ipa-collect-lldp via environment variable #944

@PDCuong

Description

@PDCuong

Description

Current Behavior

Currently, the ipa-collect-lldp parameter in ironic-config/ironic.conf.j2 is hardcoded to 1. This prevents users from disabling LLDP collection during the inspection process when using certain deployment methods like Virtual Media.

In contrast, ironic-config/inspector.ipxe.j2 already correctly implements this as an optional environment variable.

Code Comparison

1. In ironic-config/inspector.ipxe.j2 (Correct):

ipa-collect-lldp={{ env.IRONIC_IPA_COLLECT_LLDP | default('1') }}

2. In ironic-config/ironic.conf.j2 (Hardcoded):

ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1

Expected Behavior

The ironic.conf.j2 template should use the IRONIC_IPA_COLLECT_LLDP environment variable (consistent with the iPXE template) to allow users to toggle LLDP collection.


Proposed Change

In ironic-config/ironic.conf.j2, change the line:

# From:
ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp=1

# To:
ipa-inspection-dhcp-all-interfaces=1 ipa-collect-lldp={{ env.IRONIC_IPA_COLLECT_LLDP | default('1') }}

Impact

This change allows users to set IRONIC_IPA_COLLECT_LLDP=0 in their environment to skip LLDP collection, which is useful in environments where LLDP is not required or causes delays/issues during bootstrap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions