mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-18 16:31:26 -07:00
[PR #5667/c3bc172b backport][stable-5] respect new variable property in gitlab_group_variable and gitlab_project_variable (#5678)
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>
(cherry picked from commit c3bc172bf6
)
Co-authored-by: Markus Bergholz <git@osuv.de>
This commit is contained in:
parent
77aabcd8f5
commit
14f23fbebe
4 changed files with 27 additions and 22 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue