/
check_status.yml
37 lines (29 loc) · 1.67 KB
/
check_status.yml
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
---
- name: Check if gitlab-shell is installed
set_fact:
gitlab_status_shell_installed: True
when: (ansible_local.gitlab_shell is defined and ansible_local.gitlab_shell.instance)
- name: Check if gitlab-shell has to be upgraded
set_fact:
gitlab_status_shell_upgrade: True
when: (gitlab_status_shell_installed is defined and gitlab_status_shell_installed) and
(ansible_local.gitlab_shell.instance.gitlab_version != gitlab_version) and
(ansible_local.gitlab_shell.instance.shell_version != gitlab_version_map[gitlab_version].shell)
- name: Fail if auto upgrade is disabled
fail: msg="gitlab-shell requires an upgrade but automatic upgrades are disabled"
when: (gitlab_status_shell_upgrade is defined and gitlab_status_shell_upgrade) and
(gitlab_auto_upgrade is undefined or (gitlab_auto_upgrade is defined and not gitlab_auto_ugrade))
- name: Check if GitLab CE is installed
set_fact:
gitlab_status_ce_installed: True
when: (ansible_local.gitlab_ce is defined and ansible_local.gitlab_ce.instance)
- name: Check if GitLab CE has to be upgraded
set_fact:
gitlab_status_ce_upgrade: True
when: (gitlab_status_ce_installed is defined and gitlab_status_ce_installed) and
(ansible_local.gitlab_ce.instance.gitlab_version != gitlab_version) and
(ansible_local.gitlab_ce.instance.ce_version != gitlab_version_map[gitlab_version].ce)
- name: Fail if auto upgrade is disabled
fail: msg="GitLab CE requires an upgrade but automatic upgrades are disabled"
when: (gitlab_status_ce_upgrade is defined and gitlab_status_ce_upgrade) and
(gitlab_auto_upgrade is undefined or (gitlab_auto_upgrade is defined and not gitlab_auto_upgrade))