58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
---
|
|
- name: Install dependencies packages
|
|
ansible.builtin.package:
|
|
name:
|
|
- cron
|
|
- gpg
|
|
tags: gitlab
|
|
|
|
- name: Add gpg key
|
|
ansible.builtin.apt_key:
|
|
url: https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey
|
|
tags: gitlab
|
|
|
|
- name: Add repository
|
|
ansible.builtin.apt_repository:
|
|
repo: '{{ gitlab_repository }}'
|
|
tags: gitlab
|
|
|
|
- name: Install package
|
|
ansible.builtin.package:
|
|
name:
|
|
- gitlab-ce
|
|
tags: gitlab
|
|
|
|
- name: Copy config
|
|
ansible.builtin.template:
|
|
src: gitlab.rb.j2
|
|
dest: /etc/gitlab/gitlab.rb
|
|
owner: root
|
|
group: root
|
|
mode: 0600
|
|
notify: Reconfigure gitlab
|
|
tags: gitlab
|
|
|
|
- name: Init gitlab
|
|
ansible.builtin.command: gitlab-ctl reconfigure
|
|
args:
|
|
creates: /usr/lib/systemd/system/gitlab-runsvdir.service
|
|
tags: gitlab
|
|
|
|
- name: Enable and start service
|
|
ansible.builtin.service:
|
|
name: gitlab-runsvdir
|
|
state: started
|
|
enabled: true
|
|
tags: gitlab
|
|
|
|
- name: Add backup cron
|
|
ansible.builtin.cron:
|
|
name: gitlab-backup
|
|
user: root
|
|
job: gitlab-backup create
|
|
month: '{{ gitlab_backup_cron_month | string }}'
|
|
weekday: '{{ gitlab_backup_cron_weekday | string }}'
|
|
day: '{{ gitlab_backup_cron_day | string }}'
|
|
hour: '{{ gitlab_backup_cron_hour | string }}'
|
|
minute: '{{ gitlab_backup_cron_minute | string }}'
|
|
tags: gitlab
|