Skip to content

Conversation

@cosmosified
Copy link

@cosmosified cosmosified commented Jan 16, 2024

haproxy frontend changes.
may need updating if any of the base haproxy pfsense plugin has added new fields/etc.

looks like some of the comments/ still have references to the backend.
Will clean up.

@cosmosified
Copy link
Author

@opoplawski are you on discord/slack/something?
i'll fix the pylint errors tomorrow!! THanks!

@opoplawski
Copy link
Contributor

othehunter on discord.

@@ -0,0 +1,163 @@
# -*- coding: utf-8 -*-

# Copyright: (c) 2021, Chris Morton, cosmo@cosmo.2y.net
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to update the year range here.

@@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-

# Copyright: (c) 2021, Chris Morton, cosmo@cosmo.2y.net
Copy link
Contributor

Choose a reason for hiding this comment

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

And here.

#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright: (c) 2019, Frederic Bor <frederic.bor@wanadoo.fr>
Copy link
Contributor

Choose a reason for hiding this comment

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

You probably want to add yourself here.

DOCUMENTATION = """
---
module: pfsense_haproxy_frontend
version_added: "0.6.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to 0.2.0 now.

DOCUMENTATION = """
---
module: pfsense_haproxy_frontend_server
version_added: "0.6.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

0.2.0

Comment on lines +14 to +16
extaddr=dict(required=True, type='str'),
extaddr_port=dict(required=True, type='int'),
extaddr_ssl=dict(required=True, type='str'),
Copy link
Contributor

Choose a reason for hiding this comment

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

You really don't want anything other name the id field to be required, otherwise you break removal with just the id. Use required_if with state present.

Comment on lines +14 to +15
status=dict(required=True, type='str'),
desc=dict(required=True, type='str'),
Copy link
Contributor

Choose a reason for hiding this comment

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

You really don't want anything other name the id field to be required, otherwise you break removal with just the id. Use required_if with state present.

@opoplawski
Copy link
Contributor

As an FYI - I'm doing a lot of work here: https://github.com/opoplawski/pfsensible-core/tree/module_base_extended to extend PFSenseModuleBase and write misc/generate_module to help with writing modules. It's still pretty green and changing rapidly, but I hope to have some documentation for it by the end of the week.

morey-tech added a commit to morey-tech/pfsensible-haproxy that referenced this pull request Dec 16, 2025
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
morey-tech added a commit to morey-tech/pfsensible-haproxy that referenced this pull request Dec 17, 2025
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
morey-tech added a commit to morey-tech/pfsensible-haproxy that referenced this pull request Dec 17, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants