From e9b3868658381f75d9945a5b14aed5b05d82f42f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 22 May 2023 20:42:03 +0200 Subject: [PATCH] add back the node constraint --- tasks/main.yml | 13 ++++++------- templates/epas-docker-compose.yml.j2 | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index e902b13..7126928 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -14,6 +14,12 @@ - name: Manage the installation of the ePAS configuration of the swarm service block: + - name: Add the label that will be used as a constraint for the attachments volume + docker_node: + hostname: '{{ epas_docker_attachments_node }}' + labels: + epas_storage: 'attachments' + labels_state: 'merge' - name: Add the label that will be used as a constraint for the postgresql DB docker_node: @@ -40,12 +46,5 @@ compose: - '{{ epas_compose_dir }}/docker-epas-stack.yml' - # - name: Connect the ePAS service to the haproxy-public network - # command: docker service update --network-add {{ epas_haproxy_public_net }} {{ item }} --update-delay 30s --update-parallelism 1 - # with_items: - # - '{{ epas_docker_stack_name }}_{{ epas_docker_service_server_name }}' - # ignore_errors: True - # when: epas_behind_haproxy - when: docker_swarm_manager_node is defined and docker_swarm_manager_node tags: [ 'epas', 'epas_swarm', 'epas_server' ] diff --git a/templates/epas-docker-compose.yml.j2 b/templates/epas-docker-compose.yml.j2 index fdd5912..7c2e7d9 100644 --- a/templates/epas-docker-compose.yml.j2 +++ b/templates/epas-docker-compose.yml.j2 @@ -94,6 +94,7 @@ services: placement: constraints: - node.role == worker + - {{ epas_node_constraints }} restart_policy: condition: on-failure delay: 5s