mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-09-30 05:23:21 -07:00
gitlab_*_variable: add description
option (#10812)
This commit is contained in:
parent
833e6e36de
commit
7a231a248e
5 changed files with 52 additions and 25 deletions
|
@ -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'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue