Skip to content

Instantly share code, notes, and snippets.

@logan2211
Created March 29, 2016 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save logan2211/98b3682582f557a12755 to your computer and use it in GitHub Desktop.
Save logan2211/98b3682582f557a12755 to your computer and use it in GitHub Desktop.
haproxy_service_configs: "{{ haproxy_infra + haproxy_openstack_public + haproxy_openstack_internal }}"
haproxy_infra:
- service:
haproxy_service_name: galera
haproxy_backend_nodes: "{{ [groups['galera_all'][0]] | default([]) }}" # list expected
haproxy_backup_nodes: "{{ groups['galera_all'][1:] | default([]) }}"
haproxy_port: 3306
haproxy_balance_type: tcp
haproxy_timeout_client: 5000s
haproxy_timeout_server: 5000s
haproxy_backend_options:
- "mysql-check user {{ galera_monitoring_user }}"
- service:
haproxy_service_name: repo_all
haproxy_backend_nodes: "{{ groups['pkg_repo'] | default([]) }}"
haproxy_port: 8181
haproxy_backend_port: 8181
haproxy_balance_type: http
haproxy_openstack_public:
- service:
haproxy_service_name: glance_api
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['glance_api'] | intersect(groups['glance_container']) | default([]) }}"
haproxy_port: 9292
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk /versions"
- "httplog"
- service:
haproxy_service_name: glance_registry
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['glance_registry'] | intersect(groups['glance_container']) | default([]) }}"
haproxy_port: 9191
haproxy_balance_type: http
- service:
haproxy_service_name: heat_api_cfn
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['heat_api_cfn'] | default([]) }}"
haproxy_port: 8000
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: heat_api_cloudwatch
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['heat_api_cloudwatch'] | default([]) }}"
haproxy_port: 8003
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: heat_api
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['heat_api'] | default([]) }}"
haproxy_port: 8004
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: keystone_service
haproxy_backend_nodes: "{{ groups['keystone_all'] | default([]) }}"
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_port: 5000
haproxy_ssl: "{% if haproxy_ssl | bool and keystone_service_publicuri_proto == 'https' %}true{% else %}false{% endif %}"
haproxy_balance_type: "{{ (keystone_ssl_public | bool) | ternary('tcp','http') }}"
haproxy_balance_alg: "{{ (keystone_ssl_public | bool) | ternary('source', 'leastconn') }}"
haproxy_backend_options: "{{ (keystone_ssl_public | bool) | ternary(haproxy_backend_options_https, haproxy_backend_options_http) }}"
- service:
haproxy_service_name: neutron_server
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['neutron_server'] | default([]) }}"
haproxy_port: 9696
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: nova_api_os_compute
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['nova_api_os_compute'] | default([]) }}"
haproxy_port: 8774
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: nova_console_novnc
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['nova_console'] | default([]) }}"
haproxy_ssl: "{% if haproxy_ssl | bool and nova_novncproxy_proto == 'https' %}true{% else %}false{% endif %}"
haproxy_port: 6080
haproxy_balance_type: tcp
haproxy_timeout_client: 60m
haproxy_timeout_server: 60m
haproxy_balance_alg: source
- service:
haproxy_service_name: cinder_api
haproxy_bind: "{{ external_lb_vip_address }}"
haproxy_ssl: yes
haproxy_backend_nodes: "{{ groups['cinder_api'] | default([]) }}"
haproxy_port: 8776
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: horizon
haproxy_backend_nodes: "{{ groups['horizon_all'] | default([]) }}"
haproxy_redirect_http_port: 80
haproxy_ssl: yes
haproxy_port: 443
haproxy_backend_port: 80
haproxy_balance_type: tcp
haproxy_balance_alg: source
haproxy_backend_options:
- "httpchk"
- "tcplog"
haproxy_openstack_internal:
- service:
haproxy_service_name: glance_api_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['glance_api'] | default([]) }}"
haproxy_port: 9292
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk /versions"
- "httplog"
- service:
haproxy_service_name: glance_registry_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['glance_registry'] | default([]) }}"
haproxy_port: 9191
haproxy_balance_type: http
- service:
haproxy_service_name: heat_api_cfn_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['heat_api_cfn'] | default([]) }}"
haproxy_port: 8000
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: heat_api_cloudwatch_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['heat_api_cloudwatch'] | default([]) }}"
haproxy_port: 8003
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: heat_api_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['heat_api'] | default([]) }}"
haproxy_port: 8004
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: keystone_admin
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['keystone_all'] | default([]) }}"
haproxy_port: 35357
haproxy_ssl: "{% if haproxy_ssl | bool and keystone_service_adminuri_proto == 'https' %}true{% else %}false{% endif %}"
haproxy_balance_type: "{{ (keystone_ssl_admin | bool) | ternary('tcp', 'http') }}"
haproxy_balance_alg: "{{ (keystone_ssl_admin | bool) | ternary('source', 'leastconn') }}"
haproxy_backend_options: "{{ (keystone_ssl_admin | bool) | ternary(haproxy_backend_options_https, haproxy_backend_options_http) }}"
- service:
haproxy_service_name: keystone_internal
haproxy_backend_nodes: "{{ groups['keystone_all'] }}"
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_port: 5000
haproxy_ssl: "{% if haproxy_ssl | bool and keystone_service_internaluri_proto == 'https' %}true{% else %}false{% endif %}"
haproxy_balance_type: "{{ (keystone_ssl_internal | bool) | ternary('tcp','http') }}"
haproxy_balance_alg: "{{ (keystone_ssl_internal | bool) | ternary('source', 'leastconn') }}"
haproxy_backend_options: "{{ (keystone_ssl_internal | bool) | ternary(haproxy_backend_options_https, haproxy_backend_options_http) }}"
- service:
haproxy_service_name: neutron_server_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['neutron_server'] | default([]) }}"
haproxy_port: 9696
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: nova_api_os_compute_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['nova_api_os_compute'] | default([]) }}"
haproxy_port: 8774
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
- service:
haproxy_service_name: cinder_api_internal
haproxy_bind: "{{ internal_lb_vip_address }}"
haproxy_backend_nodes: "{{ groups['cinder_api'] | default([]) }}"
haproxy_port: 8776
haproxy_balance_type: http
haproxy_backend_options:
- "forwardfor"
- "httpchk"
- "httplog"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment