mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 21:30:22 -07:00
Initial commit
This commit is contained in:
commit
aebc1b03fd
4861 changed files with 812621 additions and 0 deletions
3
tests/integration/targets/gitlab_runner/aliases
Normal file
3
tests/integration/targets/gitlab_runner/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
shippable/posix/group1
|
||||
gitlab/ci
|
||||
disabled
|
|
@ -0,0 +1,3 @@
|
|||
gitlab_project_name: ansible_test_project
|
||||
gitlab_hook_url: http://gitlab.example.com/hook
|
||||
gitlab_runner_name: ansible_test_runner
|
68
tests/integration/targets/gitlab_runner/tasks/main.yml
Normal file
68
tests/integration/targets/gitlab_runner/tasks/main.yml
Normal file
|
@ -0,0 +1,68 @@
|
|||
- name: Install required libs
|
||||
pip:
|
||||
name: python-gitlab
|
||||
state: present
|
||||
|
||||
- name: Create {{ gitlab_project_name }}
|
||||
gitlab_project:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
validate_certs: False
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
name: "{{ gitlab_project_name }}"
|
||||
state: present
|
||||
|
||||
- name: Cleanup GitLab runner
|
||||
gitlab_runner:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
validate_certs: false
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
description: "{{ gitlab_runner_name }}"
|
||||
registration_token: "{{ gitlab_runner_registration_token }}"
|
||||
state: absent
|
||||
|
||||
- name: Create GitLab Runner
|
||||
gitlab_runner:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
validate_certs: false
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
description: "{{ gitlab_runner_name }}"
|
||||
registration_token: "{{ gitlab_runner_registration_token }}"
|
||||
state: present
|
||||
register: gitlab_runner_state
|
||||
|
||||
- name: Test group created
|
||||
assert:
|
||||
that:
|
||||
- gitlab_runner_state is changed
|
||||
|
||||
|
||||
#### COMMENTED AS MODULE WILL UPDATE THE RUNNER IF EXISTS. TO BE DISCUSSED ####
|
||||
# - name: Create GitLab Runner ( Idempotency test )
|
||||
# gitlab_runner:
|
||||
# server_url: "{{ gitlab_host }}"
|
||||
# validate_certs: false
|
||||
# login_token: "{{ gitlab_login_token }}"
|
||||
# description: "{{ gitlab_runner_name }}"
|
||||
# registration_token: "{{ gitlab_runner_registration_token }}"
|
||||
# state: present
|
||||
# register: gitlab_runner_state_again
|
||||
|
||||
# - name: Test module is idempotent
|
||||
# assert:
|
||||
# that:
|
||||
# - gitlab_runner_state_again is not changed
|
||||
|
||||
- name: Remove GitLab Runner
|
||||
gitlab_runner:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
validate_certs: false
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
description: "{{ gitlab_runner_name }}"
|
||||
registration_token: "{{ gitlab_runner_registration_token }}"
|
||||
state: absent
|
||||
register: gitlab_runner_state_absent
|
||||
|
||||
- name: Assert runner has been removed
|
||||
assert:
|
||||
that:
|
||||
- gitlab_runner_state_absent is changed
|
Loading…
Add table
Add a link
Reference in a new issue