added description parameter to create request (#1196)

* added description parameter to create request

* added changelog fragment

* Update changelogs/fragments/1196-use_description-in-gitlab-group-creation.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* added integration test for description in gitlab_group

* per request in the PR, creating separate task for the description issue in the integration test

* replaced deprecated param names with new names

* description should be optional to keep backward compatibility

* Update plugins/modules/source_control/gitlab/gitlab_group.py

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky 2020-11-12 01:33:38 +13:00 committed by GitHub
parent 2b0f7b858e
commit 7db2ce5be3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 9 deletions

View file

@ -10,18 +10,18 @@
- name: Cleanup GitLab Group
gitlab_group:
server_url: "{{ gitlab_host }}"
api_url: "{{ gitlab_host }}"
validate_certs: false
login_token: "{{ gitlab_login_token }}"
api_token: "{{ gitlab_login_token }}"
name: ansible_test_group
path: ansible_test_group
state: absent
- name: Create GitLab Group
gitlab_group:
server_url: "{{ gitlab_host }}"
api_url: "{{ gitlab_host }}"
validate_certs: false
login_token: "{{ gitlab_login_token }}"
api_token: "{{ gitlab_login_token }}"
name: ansible_test_group
path: ansible_test_group
state: present
@ -35,9 +35,9 @@
- name: Create GitLab Group ( Idempotency test )
gitlab_group:
server_url: "{{ gitlab_host }}"
api_url: "{{ gitlab_host }}"
validate_certs: false
login_token: "{{ gitlab_login_token }}"
api_token: "{{ gitlab_login_token }}"
name: ansible_test_group
path: ansible_test_group
state: present
@ -47,3 +47,28 @@
assert:
that:
- gitlab_group_state_again is not changed
- name: Cleanup GitLab Group for Description Test
gitlab_group:
api_url: "{{ gitlab_host }}"
validate_certs: false
api_token: "{{ gitlab_login_token }}"
name: ansible_test_group
path: ansible_test_group
state: absent
- name: Create GitLab Group for Description Test
gitlab_group:
api_url: "{{ gitlab_host }}"
validate_certs: false
api_token: "{{ gitlab_login_token }}"
name: ansible_test_group
path: ansible_test_group
description: My Test Group
state: present
register: gitlab_group_state_desc
- name: Test group created with Description
assert:
that:
- gitlab_group_state_desc.group.description == "My Test Group"