-
Notifications
You must be signed in to change notification settings - Fork 3
/
playbook-gitlab.yml
49 lines (42 loc) · 1.49 KB
/
playbook-gitlab.yml
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
45
46
47
48
49
---
- hosts: all
become: true
become_user: root
become_method: sudo
vars:
gitlab_host: "gitlab.example.org"
gitlab_admin_username: "username"
gitlab_admin_password: "password"
gitlab_new_users:
- name: "Developer One"
user: developer1
pass: changeme
mail: [email protected]
ssh_key: "ssh-rsa AAAAB3NzaC1yc....snip...oij2== [email protected]"
- name: "Developer Two"
user: developer2
pass: changeme
email: [email protected]
ssh_key: "ssh-rsa AAAAB3NzaC1yc....snip...adv0== [email protected]"
tasks:
- name: install or check epel-release
yum: name=epel-release state=present update_cache=yes
- name: install or check pip
yum: name=python-pip state=present
- name: install or check pyapi-gitlab
pip: name=pyapi-gitlab
- name: add gitlab user
delegate_to: "{{ gitlab_host }}"
action: gitlab_user
server_url="http://{{ gitlab_host }}"
validate_certs=true
login_user="{{ gitlab_admin_username }}"
login_password="{{ gitlab_admin_password }}"
name="{{ item.name }}"
username="{{ item.user }}"
password="{{ item.pass }}"
email="{{ item.email }}"
sshkey_name=default
sshkey_file="{{ item.ssh_key }}"
state=present
with_items: "{{ gitlab_new_users }}"