Repository: ansible-collections/community.general

Issue:
gitlab_*_variables deletes all variables in purge mode
### Summary

When using community.general 7.4 to provision gitlab with an exact list of variables (purge:true) all variables get deleted. This took our GitLab env with more then 1000 repos fully offline ;-)

This is due to the change done to the modules without adding the new 'raw' parameter to the list of known parameters in the module_utils/gitlab

### Issue Type

Bug Report

### Component Name

gitlab_group_variable
gitlab_project_variable

### Ansible Version

does not matter

### Community.general Version

7.4

### Configuration

_No response_

### OS / Environment

any

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
---
- hosts: localhost
  gather_facts: false
  vars:
    gv:
      Test:
        value: "12345"
        masked: false
        protected: false
        variable_type: env_var

  tasks:
    - name: test
      community.general.gitlab_group_variable:
        api_url: "https://gitlab/"
        api_token: "secrettoken
        group: "an existing gitlab group"
        purge: true
        vars: "{{ gv }}"
```


### Expected Results

The group varibale Test is set, and no other variable

### Actual Results

no variables are set at all

### Code of Conduct

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


Discussion:

Resolving patch:
diff --git a/plugins/module_utils/gitlab.py b/plugins/module_utils/gitlab.py
--- a/plugins/module_utils/gitlab.py
+++ b/plugins/module_utils/gitlab.py
@@ -116,7 +116,7 @@ def gitlab_authentication(module):
 def filter_returned_variables(gitlab_variables):
     # pop properties we don't know
     existing_variables = [dict(x.attributes) for x in gitlab_variables]
-    KNOWN = ['key', 'value', 'masked', 'protected', 'variable_type', 'environment_scope']
+    KNOWN = ['key', 'value', 'masked', 'protected', 'variable_type', 'environment_scope', 'raw']
     for item in existing_variables:
         for key in list(item.keys()):
             if key not in KNOWN:
diff --git a/plugins/modules/gitlab_group_variable.py b/plugins/modules/gitlab_group_variable.py
--- a/plugins/modules/gitlab_group_variable.py
+++ b/plugins/modules/gitlab_group_variable.py
@@ -381,6 +381,8 @@ def main():
         group=dict(type='str', required=True),
         purge=dict(type='bool', required=False, default=False),
         vars=dict(type='dict', required=False, default=dict(), no_log=True),
+        # please mind whenever changing the variables dict to also change module_utils/gitlab.py's
+        # KNOWN dict in filter_returned_variables or bad evil will happen
         variables=dict(type='list', elements='dict', required=False, default=list(), options=dict(
             name=dict(type='str', required=True),
             value=dict(type='str', no_log=True),
diff --git a/plugins/modules/gitlab_project_variable.py b/plugins/modules/gitlab_project_variable.py
--- a/plugins/modules/gitlab_project_variable.py
+++ b/plugins/modules/gitlab_project_variable.py
@@ -404,6 +404,8 @@ def main():
         project=dict(type='str', required=True),
         purge=dict(type='bool', required=False, default=False),
         vars=dict(type='dict', required=False, default=dict(), no_log=True),
+        # please mind whenever changing the variables dict to also change module_utils/gitlab.py's
+        # KNOWN dict in filter_returned_variables or bad evil will happen
         variables=dict(type='list', elements='dict', required=False, default=list(), options=dict(
             name=dict(type='str', required=True),
             value=dict(type='str', no_log=True),


Test patch: