Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pfsensible_openvpn_server] Allow Local Database for authmode #126

Merged
merged 1 commit into from
Apr 10, 2024
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: 2 additions & 0 deletions changelogs/fragments/openvpn_localdb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- 'pfsensible_openvpn_server - Allow ``Local Database`` for ``authmode`` parameter (https://github.com/pfsensible/core/issues/125).'
2 changes: 1 addition & 1 deletion plugins/module_utils/openvpn_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def _validate_params(self):
if len(params['authmode']) > 0:
system = self.pfsense.get_element('system')
for authsrv in params['authmode']:
if len(system.findall("authserver[name='{0}']".format(authsrv))) == 0:
if authsrv != 'Local Database' and len(system.findall("authserver[name='{0}']".format(authsrv))) == 0:
self.module.fail_json(msg='Cannot find authentication server {0}.'.format(authsrv))

# validate key
Expand Down
4 changes: 3 additions & 1 deletion plugins/modules/pfsense_openvpn_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
choices: ["p2p_tls", "p2p_shared_key", "server_tls", "server_tls_user", "server_user"]
type: str
authmode:
description: Authentication servers. This list will be put into alphabetical order. Required if mode == server_tls_user.
description:
- Authentication servers. This list will be put into alphabetical order. Required if mode == server_tls_user.
- Use 'Local Database' for authentication against the local pfSense user database.
default: []
type: list
elements: str
Expand Down