This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '34-reconfigure-error-handling' into 'main'
Reconfigure GitLab if a previous reconfiguration had failed Closes #34 See merge request hifis/ansible/gitlab-role!35
- Loading branch information
Showing
5 changed files
with
131 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# SPDX-FileCopyrightText: 2021 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
|
||
- name: Copy gitlab-secrets.json | ||
copy: | ||
src: "{{ gitlab_secrets_file }}" | ||
dest: /etc/gitlab/gitlab-secrets.json | ||
owner: root | ||
group: root | ||
mode: '0600' | ||
backup: yes | ||
when: gitlab_secrets_file is defined | ||
notify: | ||
- Reconfigure Primary GitLab | ||
- Reconfigure Non Primary GitLab | ||
|
||
- name: Copy GitLab Configuration File. | ||
become: yes | ||
template: | ||
src: "{{ gitlab_configuration_file_template }}" | ||
dest: "{{ gitlab_configuration_file_path }}" | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
notify: | ||
- Reconfigure Primary GitLab | ||
- Reconfigure Non Primary GitLab | ||
|
||
- name: Create file to prevent Gitlab to restart before migrations | ||
copy: | ||
content: "" | ||
dest: /etc/gitlab/skip-auto-reconfigure | ||
force: no | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
when: gitlab_is_primary | ||
|
||
- name: Create file to prevent Gitlab to backup database | ||
copy: | ||
content: "" | ||
dest: /etc/gitlab/skip-auto-backup | ||
force: no | ||
owner: root | ||
group: root | ||
mode: '0644' | ||
when: not gitlab_is_primary | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SPDX-FileCopyrightText: 2021 Helmholtz Centre for Environmental Research (UFZ) | ||
# SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum Dresden-Rossendorf (HZDR) | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
--- | ||
- name: Ensure gitlab-ctl file exists | ||
ansible.builtin.stat: | ||
path: /usr/bin/gitlab-ctl | ||
register: gitlab_ctl | ||
|
||
- name: Reconfigure Primary GitLab | ||
become: yes | ||
ansible.builtin.command: gitlab-ctl reconfigure | ||
environment: | ||
SKIP_POST_DEPLOYMENT_MIGRATIONS: true | ||
when: | ||
- gitlab_is_primary | ||
- gitlab_ctl.stat.exists | ||
|
||
- name: Reconfigure Non Primary GitLab | ||
become: yes | ||
ansible.builtin.command: gitlab-ctl reconfigure | ||
when: | ||
- not gitlab_is_primary | ||
- gitlab_ctl.stat.exists | ||
|
||
- name: Remove file that indicates a failed reconfigure | ||
ansible.builtin.file: | ||
path: /etc/gitlab/reconfigure_failed | ||
state: absent | ||
|
||
... |