pfsensible / core

Core modules for managing pfSense firewalls with ansible
GNU General Public License v3.0
199 stars 48 forks source link

pfsense_openvpn_server - Cannot find authentication server Local Database #125

Closed mikeywuu closed 5 months ago

mikeywuu commented 5 months ago

Describe the bug Using the Local Database authentication server for the authmode setting results in an error that the server could not be found.

Expected behavior The Local Database server can be used in the list of authentication servers. I would like to have multiple authentication servers available in my openvpn server. Using any server except the Local Database works. Assigning Local Database as one of the authentication server manually via the UI also works.

Playbook

- name: Test VPN
  pfsensible.core.pfsense_openvpn_server:
    name: "DevOps VPN"
    mode: "server_tls_user"
    authmode: "Local Database"
    ca: "OpenVPN-CA"
    state: "present"
    disable: "false"

Output

ansible-playbook [core 2.16.4]
  config file = None
  configured module search path = ['/Users/me/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/me/.pyenv/versions/3.11.7/lib/python3.11/site-packages/ansible
  ansible collection location = /Users/me/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/me/.pyenv/versions/3.11.7/bin/ansible-playbook
  python version = 3.11.7 (main, Jan 25 2024, 21:33:37) [Clang 15.0.0 (clang-1500.1.0.2.5)] (/Users/me/.pyenv/versions/3.11.7/bin/python3.11)
  jinja version = 3.1.3
  libyaml = True
No config file found; using defaults
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.

PLAYBOOK: openvpn.yaml **********************************************************************************************************************************************************************************************************************
1 plays in openvpn.yaml

PLAY [pfsense] ******************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
task path: /Users/me/projects/it/repos/ansible-pfsense/openvpn.yaml:2
ok: [pfsense]

TASK [openvpn : Test VPN] *******************************************************************************************************************************************************************************************************************
task path: /Users/me/projects/it/repos/ansible-pfsense/roles/openvpn/tasks/main.yaml:26
fatal: [pfsense]: FAILED! => {"changed": false, "msg": "Cannot find authentication server Local Database."}

Environment

opoplawski commented 5 months ago

Embarrassing that we never supported this before. Please test the PR if you can. Thanks.

mikeywuu commented 5 months ago

@opoplawski I can confirm that the issue is resolved. I can now add my domain controllers beside the Local Database. Thank you very much for the quick fix!