You've already forked community.general
mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 20:21:52 +03:00
respect new variable property in gitlab_group_variable and gitlab_project_variable (#5667)
* draft * add changelog fragment * rework * rework group variables * add new line at end of file * Update plugins/module_utils/gitlab.py Co-authored-by: Nejc Habjan <hab.nejc@gmail.com> * rename * revert * return a copy * Update plugins/modules/gitlab_project_variable.py Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Nejc Habjan <hab.nejc@gmail.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
@ -110,3 +110,14 @@ def gitlab_authentication(module):
|
||||
GitLab remove Session API now that private tokens are removed from user API endpoints since version 10.2." % to_native(e))
|
||||
|
||||
return gitlab_instance
|
||||
|
||||
|
||||
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']
|
||||
for item in existing_variables:
|
||||
for key in list(item.keys()):
|
||||
if key not in KNOWN:
|
||||
item.pop(key)
|
||||
return existing_variables
|
||||
|
Reference in New Issue
Block a user