Skip to content

Reduce complexity in server.yml and templates #14906

@dguido

Description

@dguido

Summary

Several complexity reduction opportunities identified in server.yml and templates.

Changes

4.2 Deduplicate Async Job Tracking in server.yml

Current: Lines 54-115 (parallel) duplicate lines 117-135 (sequential) - 60+ lines of duplication.

Fix: Single task block with async controlled by performance_parallel_services variable.

4.3 Simplify IPv6 Conditional Pattern

Current (repeated 20+ times across templates):

{{ value_ipv4 }}{{ ', ' + value_ipv6 if ipv6_support else '' }}

Create Jinja2 Macro in roles/common/templates/macros.j2:

{% macro dual_stack(ipv4, ipv6) -%}
{{ ipv4 }}{% if ipv6_support %}, {{ ipv6 }}{% endif %}
{%- endmacro %}

4.4 Consolidate Iptables Tasks

File: roles/common/tasks/iptables.yml

Current: Two nearly identical task blocks (v4 and v6).
Refactor to single loop with condition.

Impact

  • Removes ~60 lines of duplicated code
  • Simplifies template maintenance
  • Reduces risk of v4/v6 configuration drift

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions