Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/pfsense_haproxy_frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Manage pfSense HAProxy frontends
| status | str | no | - | - | Frontend status (enabled/disabled). |
| desc | str | no | - | - | Frontend description. |
| type | str | no | http | http, https, tcp | Frontend type/mode. `http` - HTTP/HTTPS with offloading (SSL termination); `https` - SSL/HTTPS (TCP mode) for SNI-based routing; `tcp` - Plain TCP proxying for non-HTTP protocols. |
| httpclose | str | no | http-keep-alive | http-keep-alive | HTTP close mode for connection handling. Only valid for `http` type frontends. |
| httpclose | str | no | - | http-keep-alive | HTTP close mode for connection handling. Only valid for `http` type frontends. Defaults to `http-keep-alive` when `type=http` and not specified. |
| backend_serverpool | str | no | - | - | Backend server pool to use. |
| ssloffloadcert | str | no | - | - | SSL certificate for offloading. |
| ssloffloadcert_type_search | str | no | descr | - | Field type to search for SSL certificate. |
Expand Down
8 changes: 6 additions & 2 deletions plugins/module_utils/haproxy_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
status=dict(required=False, type='str'),
desc=dict(required=False, type='str'),
type=dict(default='http', choices=['http', 'https', 'tcp']),
httpclose=dict(default='http-keep-alive', choices=['http-keep-alive']),
httpclose=dict(required=False, choices=['http-keep-alive']),
backend_serverpool=dict(required=False, type='str'),
ssloffloadcert=dict(required=False, type='str'),
ssloffloadcert_type_search=dict(default='descr', type='str'),
Expand Down Expand Up @@ -63,7 +63,11 @@ def _params_to_obj(self):
self._get_ansible_param(obj, 'status')
# Only add httpclose for HTTP mode (not https or tcp)
if obj.get('type', 'http') == 'http':
self._get_ansible_param(obj, 'httpclose')
# Apply default if not explicitly set
if self.params.get('httpclose') is None:
obj['httpclose'] = 'http-keep-alive'
else:
self._get_ansible_param(obj, 'httpclose')
self._get_ansible_param(obj, 'backend_serverpool')
self._get_ansible_param(obj, 'max_connections')

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/pfsense_haproxy_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
description:
- HTTP close mode for connection handling.
- Only valid for C(http) type frontends.
- Defaults to C(http-keep-alive) when C(type=http) and not specified.
required: false
type: str
choices: ['http-keep-alive']
default: 'http-keep-alive'
backend_serverpool:
description: Backend server pool to use.
required: false
Expand Down