Create the networks used by haproxy and attach it to them
This commit is contained in:
parent
7f79381d55
commit
65856cbbc4
|
@ -8,5 +8,5 @@
|
||||||
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg owner=root group=root mode='0444'
|
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg owner=root group=root mode='0444'
|
||||||
notify: Reload the HAPROXY configuration
|
notify: Reload the HAPROXY configuration
|
||||||
|
|
||||||
when: docker_swarm_manager_main_node
|
when: docker_swarm_manager_main_node | bool
|
||||||
tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker', 'haproxy_conf' ]
|
tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker', 'haproxy_conf' ]
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
- name: Create the networks that haproxy will attach to
|
||||||
|
block:
|
||||||
|
- name: Create the overlay networks
|
||||||
|
docker_network:
|
||||||
|
name: '{{ item }}'
|
||||||
|
driver: overlay
|
||||||
|
with_items: '{{ docker_swarm_haproxy_networks }}'
|
||||||
|
|
||||||
|
- name: Connect haproxy to the overlay networks
|
||||||
|
docker_network:
|
||||||
|
name: '{{ item }}'
|
||||||
|
connected:
|
||||||
|
- 'haproxy_haproxy'
|
||||||
|
append: yes
|
||||||
|
|
||||||
|
when: docker_swarm_manager_main_node | bool
|
||||||
|
tags: [ 'haproxy', 'docker_haproxy', 'docker_swarm', 'docker', 'docker_network' ]
|
|
@ -1,4 +1,6 @@
|
||||||
---
|
---
|
||||||
|
- import_tasks: haproxy_networks.yml
|
||||||
|
when: docker_swarm_cluster_haproxy_install
|
||||||
- import_tasks: haproxy_conf.yml
|
- import_tasks: haproxy_conf.yml
|
||||||
when: docker_swarm_cluster_haproxy_install
|
when: docker_swarm_cluster_haproxy_install
|
||||||
- import_tasks: portainer.yml
|
- import_tasks: portainer.yml
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
- /srv/portainer-agent-stack.yml
|
- /srv/portainer-agent-stack.yml
|
||||||
run_once: True
|
run_once: True
|
||||||
|
|
||||||
when: docker_swarm_manager_main_node
|
when: docker_swarm_manager_main_node | bool
|
||||||
tags: [ 'portainer', 'docker_portainer', 'docker_swarm', 'docker' ]
|
tags: [ 'portainer', 'docker_portainer', 'docker_swarm', 'docker' ]
|
||||||
|
|
|
@ -45,7 +45,8 @@ services:
|
||||||
- '{{ constraint }}'
|
- '{{ constraint }}'
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if docker_log_to_journal %}
|
{% if docker_log_to_journal %}
|
||||||
log_driver: 'journald'
|
logging:
|
||||||
|
driver: 'journald'
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|
Loading…
Reference in New Issue