From 23b646d5c25e37fe8ea85c6f1e9d199e6ae43065 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 21:49:39 +0200 Subject: [PATCH] [PR #9010/12fa2452 backport][stable-9] update gitlab label's color (#9034) update gitlab label's color (#9010) * update gitlab label's color fail if both new_name and color are missing, as per Gitlab API docs. * add changelog * Update changelog with suggestion Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * remove unneeded check * Update changelog --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> (cherry picked from commit 12fa2452d8f6f38e4601c0b9fc30f489f971907f) Co-authored-by: Gabriele Pongelli --- changelogs/fragments/9010-edit-gitlab-label-color.yaml | 2 ++ plugins/modules/gitlab_label.py | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/9010-edit-gitlab-label-color.yaml diff --git a/changelogs/fragments/9010-edit-gitlab-label-color.yaml b/changelogs/fragments/9010-edit-gitlab-label-color.yaml new file mode 100644 index 0000000000..0959e57772 --- /dev/null +++ b/changelogs/fragments/9010-edit-gitlab-label-color.yaml @@ -0,0 +1,2 @@ +bugfixes: + - gitlab_label - update label's color (https://github.com/ansible-collections/community.general/pull/9010). diff --git a/plugins/modules/gitlab_label.py b/plugins/modules/gitlab_label.py index 635033ab6c..f6e9172eb3 100644 --- a/plugins/modules/gitlab_label.py +++ b/plugins/modules/gitlab_label.py @@ -275,6 +275,8 @@ class GitlabLabels(object): _label.description = var_obj.get('description') if var_obj.get('priority') is not None: _label.priority = var_obj.get('priority') + if var_obj.get('color') is not None: + _label.color = var_obj.get('color') # save returns None _label.save()