summaryrefslogtreecommitdiff
path: root/test/integration/targets/gitlab_group/tasks/main.yml
blob: ab87e45e6169b4b1c12e8c5565dcabac94c3dbbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
- name: Install required libs
  pip:
    name: python-gitlab
    state: present

- name: Cleanup GitLab Group
  gitlab_group:
    server_url: "{{ gitlab_host }}"
    validate_certs: false
    login_token: "{{ gitlab_login_token }}"
    name: ansible_test_group
    path: ansible_test_group
    state: absent

- name: Create GitLab Group
  gitlab_group:
    server_url: "{{ gitlab_host }}"
    validate_certs: false
    login_token: "{{ gitlab_login_token }}"
    name: ansible_test_group
    path: ansible_test_group
    state: present
  register: gitlab_group_state

- name: Test group created
  assert:
    that:
      - gitlab_group_state is changed


- name: Create GitLab Group ( Idempotency test )
  gitlab_group:
    server_url: "{{ gitlab_host }}"
    validate_certs: false
    login_token: "{{ gitlab_login_token }}"
    name: ansible_test_group
    path: ansible_test_group
    state: present
  register: gitlab_group_state_again

- name: Test module is idempotent
  assert:
    that:
      - gitlab_group_state_again is not changed