Skip to content

Commit

Permalink
[pfsensible_openvpn_server] Allow Local Database for authmode f…
Browse files Browse the repository at this point in the history
…ixes #125.
  • Loading branch information
opoplawski committed Apr 9, 2024
1 parent 5ada6e4 commit 633cb31
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
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

0 comments on commit 633cb31

Please sign in to comment.