James E. Blair 4b031f9f24 Run an haproxy load balancer for gitea
This runs an haproxy which is strikingly similar to the one we
currently run for git.openstack.org, but it is run in a docker
container.

Change-Id: I647ae8c02eb2cd4f3db2b203d61a181f7eb632d2
2019-02-22 12:54:04 -08:00

27 lines
587 B
YAML

- 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
- name: Install docker-compose
package:
name:
- docker-compose
state: present
- name: Run docker-compose up
shell:
cmd: docker-compose up -d
chdir: /etc/haproxy-docker/