Skip to content
Snippets Groups Projects
Commit a9f2c5e2 authored by Дмитрий Сафронов's avatar Дмитрий Сафронов :eye:
Browse files

test

parent a116bc35
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@
pkg:
- gitlab-ce
- name: Create a directory for external configs
- name: Create a directory for config backups
ansible.builtin.file:
path: "/opt/gitlab.rb"
state: directory
......@@ -51,22 +51,29 @@
group: root
mode: '0755'
- name: Template a file to /opt/gitlab.rb/_version_
- name: Populate gitlab config
ansible.builtin.copy:
content: |
{{ gitlab_config }}
dest: "/opt/gitlab.rb/{{ config_date_time }}"
dest: "/etc/gitlab/gitlab.rb/"
owner: root
group: root
mode: '0644'
backup: yes
register: gitlab_config
notify: Reconfigure gitlab
- debug: var=gitlab_config.backup_file
- name: Backup previous gitlab config
ansible.builtin.copy:
dest: "/opt/gitlab.rb"
src: "{{ gitlab_config.backup_file }}"
remote_src: true
when: gitlab_config.changed
- name: Create a hard link to /opt/gitlab.rb/_version_
- name: Remove backup file from gitlab config dir
ansible.builtin.file:
src: "/opt/gitlab.rb/{{ config_date_time }}"
dest: /etc/gitlab/gitlab.rb
owner: root
group: root
mode: '0644'
state: hard
force: yes
notify: Reconfigure gitlab
path: "{{ gitlab_config.backup_file }}"
state: absent
when: gitlab_config.changed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment