diff --git a/playbooks/roles/haproxy_server/tasks/haproxy_install_apt.yml b/playbooks/roles/haproxy_server/tasks/haproxy_install_apt.yml index 9fb376e3e2..a6533a3f82 100644 --- a/playbooks/roles/haproxy_server/tasks/haproxy_install_apt.yml +++ b/playbooks/roles/haproxy_server/tasks/haproxy_install_apt.yml @@ -16,7 +16,6 @@ # NOTE(cloudnull) This can be removed when we drop 14.04 support - include: haproxy_add_ppa_repo.yml when: - - haproxy_ssl | bool - ansible_distribution_version | version_compare('16.04', '<') #TODO(evrardjp): Replace the next 2 tasks by a standard apt with cache diff --git a/playbooks/roles/haproxy_server/templates/service.j2 b/playbooks/roles/haproxy_server/templates/service.j2 index 86e5e3d542..e799bb3b11 100644 --- a/playbooks/roles/haproxy_server/templates/service.j2 +++ b/playbooks/roles/haproxy_server/templates/service.j2 @@ -25,7 +25,7 @@ {% endif -%} {% for vip_bind in vip_binds %} -{% if item.service.haproxy_redirect_http_port is defined %} +{% if item.service.haproxy_redirect_http_port is defined and item.service.haproxy_ssl %} {% if (loop.index == 1 or item.service.haproxy_ssl_all_vips | default(false) | bool) %} frontend {{ item.service.haproxy_service_name }}-redirect-front-{{ loop.index }} diff --git a/playbooks/vars/configs/haproxy_config.yml b/playbooks/vars/configs/haproxy_config.yml index ebec2ac6b6..0a07864b8d 100644 --- a/playbooks/vars/configs/haproxy_config.yml +++ b/playbooks/vars/configs/haproxy_config.yml @@ -161,7 +161,7 @@ haproxy_service_configs: haproxy_backend_nodes: "{{ groups['horizon_all'] | default([]) }}" haproxy_ssl: "{{ haproxy_ssl }}" haproxy_ssl_all_vips: true - haproxy_port: 443 + haproxy_port: "{{ haproxy_ssl | ternary(443,80) }}" haproxy_backend_port: 80 haproxy_redirect_http_port: 80 haproxy_balance_type: http