summaryrefslogtreecommitdiff
path: root/roles/gitlab/tasks/main.yml
blob: 5605e22777569ed27d634aec41f6749d3420925e (plain)
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
- 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