mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-27 00:46:34 +00:00
[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:
@@ -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'),
|
||||
|
||||
Reference in New Issue
Block a user