8eb981b47f
We want to use stop_grace_period to manage gerrit service stops. This feature was added in docker-compose 1.10 but the distro provides 1.5. Work around this by installing docker-compose from pypi. This seems like a useful feature and we want to manage docker-compose the same way globally so move docker-compose installation into the install-docker role. New docker-compose has slightly different output that we must check for in the gitea start/stop machinery. We also need to check for different container name formatting in our test cases. We should pause here and consider if this has any upgrade implications for our existing services. Change-Id: Ia8249a2b84a2ef167ee4ffd66d7a7e7cff8e21fb
34 lines
803 B
YAML
34 lines
803 B
YAML
- name: Install socat for haproxy management
|
|
package:
|
|
name: socat
|
|
state: present
|
|
- name: Synchronize docker-compose directory
|
|
synchronize:
|
|
src: docker/
|
|
dest: /etc/haproxy-docker/
|
|
- name: Ensure registry volume directories exists
|
|
file:
|
|
state: directory
|
|
path: "/var/haproxy/{{ item }}"
|
|
owner: 1000
|
|
group: 1000
|
|
loop:
|
|
- etc
|
|
- run
|
|
- name: Write haproxy config file
|
|
template:
|
|
src: haproxy.cfg.j2
|
|
dest: /var/haproxy/etc/haproxy.cfg
|
|
notify: Reload haproxy
|
|
- name: Run docker-compose pull
|
|
shell:
|
|
cmd: docker-compose pull
|
|
chdir: /etc/haproxy-docker/
|
|
- name: Run docker-compose up
|
|
shell:
|
|
cmd: docker-compose up -d
|
|
chdir: /etc/haproxy-docker/
|
|
- name: Run docker prune to cleanup unneeded images
|
|
shell:
|
|
cmd: docker image prune -f
|