2020-10-01 17:38:36 +02:00
|
|
|
---
|
2020-10-01 18:28:54 +02:00
|
|
|
- name: Create the networks that haproxy will attach to and that are not created by the services
|
2020-10-01 17:38:36 +02:00
|
|
|
block:
|
2020-10-01 18:28:54 +02:00
|
|
|
- name: Create the overlay networks that are not created by the services
|
2020-10-01 17:38:36 +02:00
|
|
|
docker_network:
|
|
|
|
name: '{{ item }}'
|
|
|
|
driver: overlay
|
2020-10-01 18:04:08 +02:00
|
|
|
scope: swarm
|
2020-10-01 18:28:54 +02:00
|
|
|
with_items: '{{ docker_swarm_haproxy_additional_networks }}'
|
2020-10-01 17:38:36 +02:00
|
|
|
|
2020-10-05 18:01:11 +02:00
|
|
|
- name: Connect haproxy to the overlay networks
|
|
|
|
docker_compose:
|
2020-10-05 18:38:20 +02:00
|
|
|
project_name: haproxy_haproxy
|
2020-10-05 18:01:11 +02:00
|
|
|
definition:
|
2020-10-05 18:48:55 +02:00
|
|
|
version: '3'
|
2020-10-05 18:01:11 +02:00
|
|
|
services:
|
2020-10-05 18:38:20 +02:00
|
|
|
haproxy_haproxy:
|
2020-10-05 18:01:11 +02:00
|
|
|
networks: '{{ docker_swarm_haproxy_networks }}'
|
|
|
|
ignore_errors: True
|
2020-10-01 17:38:36 +02:00
|
|
|
|
2020-10-05 18:01:11 +02:00
|
|
|
- name: Connect haproxy to the overlay networks
|
|
|
|
docker_compose:
|
2020-10-05 18:38:20 +02:00
|
|
|
project_name: haproxy_haproxy
|
2020-10-05 18:01:11 +02:00
|
|
|
definition:
|
2020-10-05 18:48:55 +02:00
|
|
|
version: '3'
|
2020-10-05 18:01:11 +02:00
|
|
|
services:
|
2020-10-05 18:38:20 +02:00
|
|
|
haproxy_haproxy:
|
2020-10-05 18:01:11 +02:00
|
|
|
networks: '{{ docker_swarm_haproxy_additional_networks }}'
|
|
|
|
ignore_errors: True
|
2020-10-01 18:28:54 +02:00
|
|
|
|
2020-10-01 17:38:36 +02:00
|
|
|
when: docker_swarm_manager_main_node | bool
|
|
|
|
tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker', 'docker_network' ]
|