-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitlab_setup.yaml
executable file
·108 lines (91 loc) · 2.67 KB
/
gitlab_setup.yaml
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
---
- hosts: gitlab
become: yes
tasks:
- name: "Update system with Latest Packages"
ansible.builtin.dnf:
name: "*"
state: latest
- name: "restart system to reboot to newest kernel"
shell: "sleep 5 && reboot"
async: 1
poll: 0
- name: "wait for 10 seconds"
pause:
seconds: 10
- name: "wait for the system to reboot"
wait_for_connection:
connect_timeout: 20
sleep: 5
delay: 5
timeout: 60
- name: "Server List"
ansible.builtin.ping:
register: ping_output
- name: "Ping Output"
debug:
msg: "{{ ping_output }}"
- name: "Check Uptime"
ansible.builtin.command:
cmd: uptime
register: uptime_output
- name: "Uptime Output"
debug:
var: uptime_output.stdout
- name: "Install Gitlab"
ansible.builtin.dnf:
name:
- curl
- vim
- policycoreutils
- python3-policycoreutils
- git
state: present
- name: "Installation Prereq"
ansible.builtin.command:
cmd: "yum list curl vim policycoreutils python3-policycoreutils git"
register: package_verification
- name: "Package Verification"
debug:
var: package_verification.stdout
- name: "Git Lab CE Repository Creation"
ansible.builtin.blockinfile:
block: |
[gitlab_gitlab-ce]
name=gitlab_gitlab-ce
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
[gitlab_gitlab-ce-source]
name=gitlab_gitlab-ce-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ce/el/8/SRPMS
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey/gitlab-gitlab-ce-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
path: /etc/yum.repos.d/gitlab.repo
create: true
# - name: "Import Jenkins Key"
# ansible.builtin.rpm_key:
# state: present
# key: https://pkg.jenkins.io/redhat-stable/jenkins.io.key
#
#
- name: "Install Jenkins Package"
ansible.builtin.dnf:
name: gitlab-ce
state: latest
register: package_installation
- name: "Verify Package Installation"
debug:
var: package_installation