Repository: ansible-collections/community.general

Issue:
Various Pritunl API methods do not honour `validate_certs`
### Summary

Various methods of the Pritunl module do not honour the `validate_certs` parameter. Hardcoded values of `True` exist which ignore any user passing of `False`.

The harecoded `True` values make it impossible to bypass certificate validation when using various methods of the Pritunl module.

### Issue Type

Bug Report

### Component Name

pritunl

### Ansible Version

```console
ansible [core 2.15.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/daniel/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/daniel/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True
```


### Community.general Version

```console
# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 7.3.0
```

### Configuration

_No response_

### OS / Environment

Ubuntu 22.04.2 LTS

### Steps to Reproduce

```yaml
- block:
  - name: "Install Pritunl | Create Organisation"
    community.general.pritunl_org:
      name: NAME
      pritunl_api_secret: SECRET
      pritunl_api_token: TOKEN
      pritunl_url: https://URL
      validate_certs: False
      state: present
```


### Expected Results

I expected the call to ignore self signed certificates

### Actual Results

```console
TASK [pritunl-server-ubuntu : Install Pritunl | Create Organisation] ***************************************************************
fatal: [server01-vm_8aac]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "msg": "<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1131)>"}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:

Resolving patch:
diff --git a/plugins/module_utils/net_tools/pritunl/api.py b/plugins/module_utils/net_tools/pritunl/api.py
--- a/plugins/module_utils/net_tools/pritunl/api.py
+++ b/plugins/module_utils/net_tools/pritunl/api.py
@@ -220,7 +220,7 @@ def post_pritunl_organization(
         api_secret=api_secret,
         base_url=base_url,
         organization_data={"name": organization_name},
-        validate_certs=True,
+        validate_certs=validate_certs,
     )
 
     if response.getcode() != 200:
@@ -248,7 +248,7 @@ def post_pritunl_user(
             base_url=base_url,
             organization_id=organization_id,
             user_data=user_data,
-            validate_certs=True,
+            validate_certs=validate_certs,
         )
 
         if response.getcode() != 200:
@@ -267,7 +267,7 @@ def post_pritunl_user(
             organization_id=organization_id,
             user_data=user_data,
             user_id=user_id,
-            validate_certs=True,
+            validate_certs=validate_certs,
         )
 
         if response.getcode() != 200:
@@ -287,7 +287,7 @@ def delete_pritunl_organization(
         api_secret=api_secret,
         base_url=base_url,
         organization_id=organization_id,
-        validate_certs=True,
+        validate_certs=validate_certs,
     )
 
     if response.getcode() != 200:
@@ -307,7 +307,7 @@ def delete_pritunl_user(
         base_url=base_url,
         organization_id=organization_id,
         user_id=user_id,
-        validate_certs=True,
+        validate_certs=validate_certs,
     )
 
     if response.getcode() != 200:


Test patch: