[PR #10812/7a231a24 backport][stable-11] gitlab_*_variable: add description option (#10834)

gitlab_*_variable: add `description` option (#10812)

(cherry picked from commit 7a231a248e)

Co-authored-by: David Phillips <phillid@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-09-18 22:14:48 +02:00 committed by GitHub
commit 9a3fd8fabe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 52 additions and 25 deletions

View file

@ -134,7 +134,7 @@ def gitlab_authentication(module, min_version=None):
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', 'hidden', 'protected', 'variable_type', 'environment_scope', 'raw']
KNOWN = ['key', 'value', 'description', 'masked', 'hidden', 'protected', 'variable_type', 'environment_scope', 'raw']
for item in existing_variables:
for key in list(item.keys()):
if key not in KNOWN:
@ -151,6 +151,7 @@ def vars_to_variables(vars, module):
{
"name": item,
"value": str(value),
"description": None,
"masked": False,
"protected": False,
"hidden": False,
@ -163,6 +164,7 @@ def vars_to_variables(vars, module):
new_item = {
"name": item,
"value": value.get('value'),
"description": value.get('description'),
"masked": value.get('masked'),
"hidden": value.get('hidden'),
"protected": value.get('protected'),