From 7ddad3f3d572182f1f4d42925e17217e7752e182 Mon Sep 17 00:00:00 2001 From: SamYaple Date: Tue, 16 Feb 2016 20:28:51 +0000 Subject: [PATCH] Move haproxy socket to volume Partial-Bug: #1544545 Change-Id: I292bcaeacb080ff4c5ab6b42b7d899039d6b19c4 --- ansible/roles/haproxy/tasks/start.yml | 26 +++++++++---------- .../roles/haproxy/templates/haproxy.cfg.j2 | 2 +- docker/keepalived/check_alive.sh | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ansible/roles/haproxy/tasks/start.yml b/ansible/roles/haproxy/tasks/start.yml index 5f838cd512..0193350f70 100644 --- a/ansible/roles/haproxy/tasks/start.yml +++ b/ansible/roles/haproxy/tasks/start.yml @@ -1,16 +1,4 @@ --- -- name: Starting keepalived container - kolla_docker: - action: "start_container" - common_options: "{{ docker_common_options }}" - image: "{{ keepalived_image_full }}" - name: "keepalived" - privileged: True - volumes: - - "{{ node_config_directory }}/keepalived/:{{ container_config_directory }}/:ro" - - "/run:/run" - - "/lib/modules:/lib/modules:ro" - - name: Starting haproxy container kolla_docker: action: "start_container" @@ -20,7 +8,19 @@ privileged: True volumes: - "{{ node_config_directory }}/haproxy/:{{ container_config_directory }}/:ro" - - "/run:/run" + - "haproxy_socket:/var/lib/kolla/haproxy/" + +- name: Starting keepalived container + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + image: "{{ keepalived_image_full }}" + name: "keepalived" + privileged: True + volumes: + - "{{ node_config_directory }}/keepalived/:{{ container_config_directory }}/:ro" + - "/lib/modules:/lib/modules:ro" + - "haproxy_socket:/var/lib/kolla/haproxy/" - name: Ensuring latest haproxy config is used command: docker exec haproxy /usr/local/bin/kolla_ensure_haproxy_latest_config diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index e8af22ea1e..d45682d31d 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -1,7 +1,7 @@ global daemon maxconn 4000 - stats socket /run/haproxy.sock + stats socket /var/lib/kolla/haproxy/haproxy.sock defaults mode http diff --git a/docker/keepalived/check_alive.sh b/docker/keepalived/check_alive.sh index 8c2684f10b..9bb87d7b78 100644 --- a/docker/keepalived/check_alive.sh +++ b/docker/keepalived/check_alive.sh @@ -3,4 +3,4 @@ # This will return 0 when it successfully talks to the haproxy daemon via the socket # Failures return 1 -echo "show info" | socat unix-connect:/run/haproxy.sock stdio +echo "show info" | socat unix-connect:/var/lib/kolla/haproxy/haproxy.sock stdio