-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate-gitlab.yml
63 lines (55 loc) · 1.46 KB
/
update-gitlab.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
- name: Playbook for auto update of Gitlab-CE
hosts: localhost
gather_facts: yes
become: true
tasks:
- name: Remove latest image
docker_image:
name: gitlab/gitlab-ce:latest
state: absent
- name: Check if new image exists
docker_image:
name: gitlab/gitlab-ce:latest
source: pull
register: pull
- name: Check if container exists
docker_container_info:
name: gitlab
when: pull.changed
- name: Stop gitlab container
docker_container:
name: gitlab
state: stopped
when: pull.changed
- name: remove gitlab container
docker_container:
name: gitlab
state: absent
when: pull.changed
- name: update gitlab-ce
docker_container:
name: gitlab
image: gitlab/gitlab-ce:latest
state: started
restart: yes
volumes:
- /srv/gitlab/config:/etc/gitlab:Z
- /srv/gitlab/logs:/var/log/gitlab:Z
- /srv/gitlab/data:/var/opt/gitlab:Z
- /mnt:/mnt:Z
published_ports:
- 443:443
- 80:80
- 0.0.0.0:22:22
when: pull.changed
- name: Start gitlab container
docker_container:
name: gitlab
state: started
when: pull.changed
- name: Send notis to Cisco webbex teams
script: update-notis.sh
when: pull.changed
- name: Clean up
command: docker system prune