ansible-role-gitlab/tasks/main.yml

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