haproxy: mount the docker socket
This commit is contained in:
parent
3f2ba86680
commit
451479c8d3
|
@ -1,4 +1,14 @@
|
|||
---
|
||||
- name: Manage the composition of haproxy as a docker swarm service
|
||||
block:
|
||||
- name: Create the local haproxy configuration directory
|
||||
file: dest=/etc/haproxy state=directory mode='0755'
|
||||
|
||||
- name: Install a bare haproxy configuration if there's none
|
||||
copy: src=haproxy-sample.cfg dest=/etc/haproxy/haproxy.cfg mode='0644' force=no
|
||||
|
||||
tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker' ]
|
||||
|
||||
- name: Manage the composition of haproxy as a docker swarm service
|
||||
block:
|
||||
- name: Create the destination directory of the haproxy docker compose file
|
||||
|
@ -7,12 +17,6 @@
|
|||
- name: Install the docker compose file
|
||||
template: src=haproxy-docker-stack.yml.j2 dest={{ haproxy_docker_compose_dir }}/docker-haproxy-stack.yml mode='0644'
|
||||
|
||||
- name: Create the local haproxy configuration directory
|
||||
file: dest=/etc/haproxy state=directory mode='0755'
|
||||
|
||||
- name: Install a bare haproxy configuration if there's none
|
||||
copy: src=haproxy-sample.cfg dest=/etc/haproxy/haproxy.cfg mode='0644' force=no
|
||||
|
||||
- name: Run the docker compose file to start the service
|
||||
docker_stack:
|
||||
name: haproxy
|
||||
|
|
|
@ -6,6 +6,7 @@ services:
|
|||
volumes:
|
||||
- {{ haproxy_cert_dir }}:{{ haproxy_cert_dir }}:ro
|
||||
- /etc/haproxy:/usr/local/etc/haproxy:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
ports:
|
||||
- target: {{ haproxy_default_port }}
|
||||
published: {{ haproxy_default_port }}
|
||||
|
|
Loading…
Reference in New Issue