feat: add HAProxy frontend and frontend server modules#2
Merged
morey-tech merged 6 commits intomainfrom Dec 17, 2025
Merged
Conversation
- Add haproxy_frontend module for managing pfSense HAProxy frontends - Add haproxy_frontend_server module for managing frontend servers - Add Chris Morton to authors in galaxy.yml - Add macOS .DS_Store to .gitignore
Add complete Ansible module implementation for HAProxy frontends and frontend servers with corrected required field logic. Module Utils Changes: - Update copyright year to 2025 in haproxy_frontend.py - Update copyright year to 2025 in haproxy_frontend_server.py - Change required=True to required=False for non-primary-key fields (status, desc, extaddr, extaddr_port, extaddr_ssl) - Only primary identifiers remain required (name, frontend) New Ansible Modules: - Add pfsense_haproxy_frontend module for managing HAProxy frontends - Add pfsense_haproxy_frontend_server module for managing bind addresses - Set version_added to 0.2.0 for new release - Include comprehensive documentation and examples - Follow existing backend module patterns for consistency This allows deletion operations with minimal parameters (just state=absent plus identifier) and maintains consistency with the existing backend module architecture. Addresses feedback from: pfsensible#1
660510d to
f8f34d1
Compare
- Fix PEP8 formatting errors in haproxy_frontend.py and haproxy_frontend_server.py - Remove unused import and debug print statement in haproxy_frontend_server.py - Install pfsensible.core dependency in workspace collection root for ansible-test - Add shellcheck to devcontainer dependencies - Add sanity test ignore file for devcontainer script shebang All sanity tests now pass with zero warnings or errors.
Unit tests were failing due to missing community.internal_test_tools collection. Added symlink in postCreate.sh to make the collection accessible to ansible-test in the workspace directory structure.
Add pre-commit framework to run automated tests before commits: - pycodestyle for Python style checking - ansible-test sanity for module validation - ansible-test units for unit tests Pre-commit hooks are automatically installed during devcontainer setup and provide fast local feedback matching CI checks.
Add dedicated pr-checks job that runs on pull requests: - Matches pre-commit hooks (pycodestyle, sanity, units) - Provides fast feedback (~5 min vs ~15 min full matrix) - Rich test summaries with pass/fail status - Can be configured as required status check Updated build job: - Skip on PRs (pr-checks handles PR validation) - Upgrade to latest actions (v4, v5) - Add test summaries for better visibility - Separate sanity and units into distinct steps Both jobs now provide consistent formatting and detailed GitHub Actions summaries showing test results.
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.
Summary
This PR adds complete Ansible module support for managing HAProxy frontends and frontend servers (bind addresses/ports) in pfSense.
This implementation is based on the original work from @cosmosified in the upstream PR #1, with all requested changes from the code review incorporated.
Changes
New Ansible Modules
pfsense_haproxy_frontend- Manage HAProxy frontend configurationspfsense_haproxy_frontend_server- Manage HAProxy frontend bind addresses and portsModule Utils
haproxy_frontend.py- Core module utilities for frontend managementhaproxy_frontend_server.py- Core module utilities for frontend server managementMetadata Updates
galaxy.ymlauthors list.DS_Storeentry to.gitignoreImplementation Details
Module Design
name,frontend) are required=Truestate: present/absentfor idempotent managementDocumentation
Version
version_added: 0.2.0for both new modules (next minor release)Code Review Changes Addressed
All feedback from PR #1 has been implemented:
Testing
The modules follow the established patterns from
pfsense_haproxy_backendandpfsense_haproxy_backend_server, ensuring consistency with existing functionality.Suggested test scenarios:
Related