forked from chr4/salt-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
registry-garbage-collect.sls
36 lines (35 loc) · 1.28 KB
/
registry-garbage-collect.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
35
36
# Install systemd timer and service for registry garbage collection
/lib/systemd/system/gitlab-registry-garbage-collect.service:
file.managed:
- source: salt://{{ tpldir }}/registry-garbage-collect.service.jinja
- template: jinja
- defaults:
delete_manifests: {{ salt['pillar.get']('gitlab:registry:garbage_collect:manifests', false) }}
- user: root
- group: root
- mode: 644
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- file: /lib/systemd/system/gitlab-registry-garbage-collect.service
gitlab-registry-garbage-collect.timer:
service.running:
- enable: true
- watch:
- file: /lib/systemd/system/gitlab-registry-garbage-collect.timer
- require:
- file: /lib/systemd/system/gitlab-registry-garbage-collect.timer
- cmd: systemctl daemon-reload
file.managed:
- name: /lib/systemd/system/gitlab-registry-garbage-collect.timer
- source: salt://{{ tpldir }}/registry-garbage-collect.timer.jinja
- template: jinja
- defaults:
on_calendar: {{ salt['pillar.get']('gitlab:registry:garbage_collect:on_calendar', '02:00') }}
- user: root
- group: root
- mode: 644
cmd.run:
- name: systemctl daemon-reload
- onchanges:
- file: /lib/systemd/system/gitlab-registry-garbage-collect.timer