-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_gitlab.yml
More file actions
84 lines (70 loc) · 1.91 KB
/
install_gitlab.yml
File metadata and controls
84 lines (70 loc) · 1.91 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
- name: Install GitLab on Ubuntu 22.04 with SSL
hosts: gitlab_server
become: yes
vars:
gitlab_domain: "succpinndemo.com"
tasks:
- name: Update package lists
apt:
update_cache: yes
- name: Install dependencies
apt:
name:
- curl
- openssh-server
- ca-certificates
- tzdata
- perl
state: present
- name: Install Postfix
debconf:
name: postfix
question: "postfix/main_mailer_type"
value: "Internet Site"
vtype: "string"
- name: Install Postfix package
apt:
name: postfix
state: present
- name: Ensure UFW is installed
apt:
name: ufw
state: present
- name: Allow OpenSSH, HTTP, and HTTPS in UFW
ufw:
rule: allow
port: "{{ item }}"
loop:
- "22"
- "80"
- "443"
- name: Enable UFW
command: ufw --force enable
ignore_errors: yes
- name: Add GitLab repository
shell: curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
- name: Install GitLab
apt:
name: gitlab-ee
state: present
environment:
EXTERNAL_URL: "https://{{ gitlab_domain }}"
- name: Ensure Certbot (Let's Encrypt) is installed
apt:
name: certbot
state: present
- name: Verify SSL Certificate is Obtained
shell: "openssl s_client -connect {{ gitlab_domain }}:443 -servername {{ gitlab_domain }} < /dev/null"
register: ssl_check
changed_when: false
ignore_errors: true
- name: Debug SSL Check Output
debug:
msg: "{{ ssl_check.stdout_lines }}"
- name: Display GitLab root password
command: cat /etc/gitlab/initial_root_password
register: root_password
- name: Print root password
debug:
msg: "{{ root_password.stdout }}"