summaryrefslogtreecommitdiff
path: root/roles/gitlab/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/gitlab/tasks/main.yml')
-rw-r--r--roles/gitlab/tasks/main.yml70
1 files changed, 70 insertions, 0 deletions
diff --git a/roles/gitlab/tasks/main.yml b/roles/gitlab/tasks/main.yml
new file mode 100644
index 0000000..5605e22
--- /dev/null
+++ b/roles/gitlab/tasks/main.yml
@@ -0,0 +1,70 @@
+- name: install helpful stuff
+ apt:
+ name:
+ - locales-all
+ - psmisc
+
+- name: install gitlab dependencies
+ apt:
+ name:
+ - curl
+ - openssh-server
+ - ca-certificates
+ - postfix
+ - apt-transport-https
+
+- name: set mailname
+ copy:
+ content: |
+ {{ mail_hostname }}
+ dest: /etc/mailname
+ owner: root
+ group: root
+ mode: 0644
+ notify: restart_postfix
+
+- name: configure postfix
+ template:
+ src: main.cf.j2
+ dest: /etc/postfix/main.cf
+ notify: restart_postfix
+
+- name: install gitlab apt signing key
+ apt_key:
+ data: "{{ gitlab_apt_signing_key }}"
+
+- name: install gitlab apt sources.list
+ apt_repository:
+ update_cache: yes
+ codename: "{{ debian_codename }}"
+ repo: |
+ deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ {{ debian_codename }} main
+
+- name: install gitlab-ce
+ apt:
+ name: gitlab-ce
+
+- name: configure gitlab external url
+ lineinfile:
+ path: /etc/gitlab/gitlab.rb
+ regexp: "^external_url"
+ line: |
+ external_url '{{ external_url }}'
+
+- name: configure gitlab initial root password
+ lineinfile:
+ path: /etc/gitlab/gitlab.rb
+ regexp: "gitlab_rails.'initial_root_password'"
+ line: |
+ gitlab_rails['initial_root_password'] = "{{ root_password }}"
+
+- name: configure gitlab initial runner registration token
+ lineinfile:
+ path: /etc/gitlab/gitlab.rb
+ regexp: "gitlab_rails.'initial_shared_runners_registration_token'"
+ line: |
+ gitlab_rails['initial_shared_runners_registration_token'] = "{{runner_token }}"
+
+- name: start gitlab
+ shell:
+ dpkg-reconfigure gitlab-ce