Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/gitlab_project/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Install required libs
12 pip:
13 name: python-gitlab
14 state: present
15
16 - name: Clean up {{ gitlab_project_name }}
17 gitlab_project:
18 server_url: "{{ gitlab_host }}"
19 validate_certs: false
20 login_token: "{{ gitlab_login_token }}"
21 name: "{{ gitlab_project_name }}"
22 state: absent
23
24 - name: Create {{ gitlab_project_name }}
25 gitlab_project:
26 server_url: "{{ gitlab_host }}"
27 validate_certs: false
28 login_token: "{{ gitlab_login_token }}"
29 name: "{{ gitlab_project_name }}"
30 initialize_with_readme: true
31 state: present
32 register: gitlab_project_state
33
34 - assert:
35 that:
36 - gitlab_project_state is changed
37
38 - name: Create {{ gitlab_project_name }} (Test idempotency)
39 gitlab_project:
40 server_url: "{{ gitlab_host }}"
41 validate_certs: false
42 login_token: "{{ gitlab_login_token }}"
43 name: "{{ gitlab_project_name }}"
44 state: present
45 register: gitlab_project_state_again
46
47 - assert:
48 that:
49 - gitlab_project_state_again is not changed