forked from chr4/salt-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sls
34 lines (30 loc) · 983 Bytes
/
init.sls
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
{% set edition = salt['pillar.get']('gitlab:edition', 'gitlab-ce') %}
# Setup official gitlab community repository
gitlab_repo:
pkgrepo.managed:
- name: deb https://packages.gitlab.com/gitlab/{{ edition }}/ubuntu/ {{ grains['oscodename'] }} main
- file: /etc/apt/sources.list.d/gitlab_{{ edition }}.list
- key_url: https://packages.gitlab.com/gpg.key
- require_in:
- pkg: {{ edition }}
{{ edition }}:
pkg.installed: []
/etc/gitlab/gitlab.rb:
file.managed:
- user: root
- group: root
- mode: 600 # Config file might contain credentials
- source: salt://{{ tpldir }}/gitlab.rb.jinja
- template: jinja
- require:
- pkg: {{ edition }}
cmd.run:
- name: gitlab-ctl reconfigure
- onchanges:
- file: /etc/gitlab/gitlab.rb
# In case /var/opt/gitlab/backups is a mountpoint, we need to make sure permissions are adjusted
/var/opt/gitlab/backups:
file.directory:
- user: git
- group: root
- mode: 0700