This repository has been archived by the owner on Feb 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
65 lines (54 loc) · 1.98 KB
/
playbook.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
- hosts: all
vars:
gitlab_hostname: gitlab.agoravoting.com
gitlab_passwd: secretpwd
gitlab_disable_signup: true
tasks:
- name: installing packages
sudo: true
apt: pkg={{ item }} state=present update_cache=yes
with_items:
- curl
- openssh-server
- ca-certificates
- postfix
- ruby2.0
- expect
- name: getting the package
get_url: url=https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce_8.3.2-ce.0_amd64.deb/download dest=/tmp/gitlab.deb mode=0440
- name: installing the package
sudo: true
shell: dpkg -i /tmp/gitlab.deb
- name: configuring external url
sudo: true
lineinfile: dest=/etc/gitlab/gitlab.rb regexp="^external_url" line="external_url 'https://{{ gitlab_hostname }}'"
- name: configuring external url
sudo: true
lineinfile: dest=/etc/gitlab/gitlab.rb line="{{ item }}"
with_items:
- "gitlab_rails['initial_root_password'] = '{{ gitlab_passwd }}'"
- "nginx['redirect_http_to_https'] = true"
- name: cert directories creation
sudo: true
file: path=/etc/gitlab/ssl/ recurse=yes state=directory owner=root group=www-data
- name: self-signed certificate creation script
template: src=cert.sh dest=/tmp/cert.sh mode=0777
- name: self-signed certificate creation
sudo: true
shell: "/tmp/cert.sh"
- name: configuring gitlab
sudo: true
shell: gitlab-ctl reconfigure
- name: disabling signup
sudo: true
shell: expect -c 'spawn gitlab-rails console production;
expect "%s";
send "x = ApplicationSetting.first\r";
expect "%s";
send "x.signup_enabled = false\r";
expect "%s";
send "x.save!\r";
expect "%s";
send "^D"'
when: gitlab_disable_signup