mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -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_user/aliases
Normal file
3
tests/integration/targets/gitlab_user/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
shippable/posix/group1
|
||||
gitlab/ci
|
||||
disabled
|
3
tests/integration/targets/gitlab_user/defaults/main.yml
Normal file
3
tests/integration/targets/gitlab_user/defaults/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
gitlab_user: ansible_test_user
|
||||
gitlab_user_pass: Secr3tPassw00rd
|
||||
gitlab_user_email: root@localhost
|
50
tests/integration/targets/gitlab_user/tasks/main.yml
Normal file
50
tests/integration/targets/gitlab_user/tasks/main.yml
Normal file
|
@ -0,0 +1,50 @@
|
|||
- name: Install required libs
|
||||
pip:
|
||||
name: python-gitlab
|
||||
state: present
|
||||
|
||||
- name: Clean up gitlab user
|
||||
gitlab_user:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
name: ansible_test_user
|
||||
username: ansible_test_user
|
||||
password: Secr3tPassw00rd
|
||||
email: root@localhost
|
||||
validate_certs: false
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
state: absent
|
||||
|
||||
|
||||
- name: Create gitlab user
|
||||
gitlab_user:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
email: "{{ gitlab_user_email }}"
|
||||
name: "{{ gitlab_user }}"
|
||||
username: "{{ gitlab_user }}"
|
||||
password: "{{ gitlab_user_pass }}"
|
||||
validate_certs: False
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
state: present
|
||||
register: gitlab_user_state
|
||||
|
||||
- name: Check user has been created correctly
|
||||
assert:
|
||||
that:
|
||||
- gitlab_user_state is changed
|
||||
|
||||
- name: Create gitlab user again
|
||||
gitlab_user:
|
||||
server_url: "{{ gitlab_host }}"
|
||||
email: root@localhost
|
||||
name: ansible_test_user
|
||||
username: ansible_test_user
|
||||
password: Secr3tPassw00rd
|
||||
validate_certs: False
|
||||
login_token: "{{ gitlab_login_token }}"
|
||||
state: present
|
||||
register: gitlab_user_state_again
|
||||
|
||||
- name: Check state is not changed
|
||||
assert:
|
||||
that:
|
||||
- gitlab_user_state_again is not changed
|
Loading…
Add table
Add a link
Reference in a new issue