Allow keystone services to use independent hostnames

This allows keystone service endpoints to use custom hostnames, and adds the
following variables:

* keystone_internal_fqdn
* keystone_external_fqdn

These default to the old values of kolla_internal_fqdn or
kolla_external_fqdn.

This also adds the following variables:

* keystone_admin_listen_port
* keystone_public_listen_port

These default to keystone_admin_port and keystone_public_port,
respectively, for backward compatibility.

These options allow the user to differentiate between the port the
service listens on, and the port the service is reachable on. This is
useful for external load balancers which live on the same host as the
service itself.

Change-Id: I50c46c674134f9958ee4357f0f4eed5483af2214
Implements: blueprint service-hostnames
This commit is contained in:
Jim Rollenhagen 2018-12-18 12:45:54 -05:00
parent 255fff02b7
commit bece976b91
4 changed files with 16 additions and 9 deletions

View File

@ -242,7 +242,9 @@ kafka_port: "9092"
karbor_api_port: "8799" karbor_api_port: "8799"
keystone_public_port: "5000" keystone_public_port: "5000"
keystone_public_listen_port: "{{ keystone_public_port }}"
keystone_admin_port: "35357" keystone_admin_port: "35357"
keystone_admin_listen_port: "{{ keystone_admin_port }}"
keystone_ssh_port: "8023" keystone_ssh_port: "8023"
kibana_server_port: "5601" kibana_server_port: "5601"
@ -672,9 +674,11 @@ kibana_log_prefix: "flog"
#################### ####################
# Keystone options # Keystone options
#################### ####################
keystone_admin_url: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}" keystone_internal_fqdn: "{{ kolla_internal_fqdn }}"
keystone_internal_url: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}" keystone_external_fqdn: "{{ kolla_external_fqdn }}"
keystone_public_url: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ keystone_public_port }}" keystone_admin_url: "{{ admin_protocol }}://{{ keystone_internal_fqdn }}:{{ keystone_admin_port }}"
keystone_internal_url: "{{ internal_protocol }}://{{ keystone_internal_fqdn }}:{{ keystone_public_port }}"
keystone_public_url: "{{ public_protocol }}://{{ keystone_external_fqdn }}:{{ keystone_public_port }}"
keystone_admin_user: "admin" keystone_admin_user: "admin"
keystone_admin_project: "admin" keystone_admin_project: "admin"

View File

@ -20,16 +20,19 @@ keystone_services:
mode: "http" mode: "http"
external: false external: false
port: "{{ keystone_public_port }}" port: "{{ keystone_public_port }}"
listen_port: "{{ keystone_public_listen_port }}"
keystone_external: keystone_external:
enabled: "{{ enable_keystone }}" enabled: "{{ enable_keystone }}"
mode: "http" mode: "http"
external: true external: true
port: "{{ keystone_public_port }}" port: "{{ keystone_public_port }}"
listen_port: "{{ keystone_public_listen_port }}"
keystone_admin: keystone_admin:
enabled: "{{ enable_keystone }}" enabled: "{{ enable_keystone }}"
mode: "http" mode: "http"
external: false external: false
port: "{{ keystone_admin_port }}" port: "{{ keystone_admin_port }}"
listen_port: "{{ keystone_admin_listen_port }}"
keystone-ssh: keystone-ssh:
container_name: "keystone_ssh" container_name: "keystone_ssh"
group: "keystone" group: "keystone"

View File

@ -9,7 +9,7 @@
- name: Checking free port for Keystone Admin - name: Checking free port for Keystone Admin
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ keystone_admin_port }}" port: "{{ keystone_admin_listen_port }}"
connect_timeout: 1 connect_timeout: 1
timeout: 1 timeout: 1
state: stopped state: stopped
@ -20,7 +20,7 @@
- name: Checking free port for Keystone Public - name: Checking free port for Keystone Public
wait_for: wait_for:
host: "{{ api_interface_address }}" host: "{{ api_interface_address }}"
port: "{{ keystone_public_port }}" port: "{{ keystone_public_listen_port }}"
connect_timeout: 1 connect_timeout: 1
timeout: 1 timeout: 1
state: stopped state: stopped

View File

@ -1,8 +1,8 @@
{% set keystone_log_dir = '/var/log/kolla/keystone' %} {% set keystone_log_dir = '/var/log/kolla/keystone' %}
{% set python_path = '/usr/lib/python2.7/site-packages' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %} {% set python_path = '/usr/lib/python2.7/site-packages' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/lib/python2.7/site-packages' %}
{% set binary_path = '/usr/bin' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} {% set binary_path = '/usr/bin' if keystone_install_type == 'binary' else '/var/lib/kolla/venv/bin' %}
Listen {{ api_interface_address }}:{{ keystone_public_port }} Listen {{ api_interface_address }}:{{ keystone_public_listen_port }}
Listen {{ api_interface_address }}:{{ keystone_admin_port }} Listen {{ api_interface_address }}:{{ keystone_admin_listen_port }}
ServerSignature Off ServerSignature Off
ServerTokens Prod ServerTokens Prod
@ -17,7 +17,7 @@ TraceEnable off
</Directory> </Directory>
<VirtualHost *:{{ keystone_public_port }}> <VirtualHost *:{{ keystone_public_listen_port }}>
WSGIDaemonProcess keystone-public processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }} WSGIDaemonProcess keystone-public processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }}
WSGIProcessGroup keystone-public WSGIProcessGroup keystone-public
WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-public WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-public
@ -31,7 +31,7 @@ TraceEnable off
CustomLog "{{ keystone_log_dir }}/keystone-apache-public-access.log" logformat CustomLog "{{ keystone_log_dir }}/keystone-apache-public-access.log" logformat
</VirtualHost> </VirtualHost>
<VirtualHost *:{{ keystone_admin_port }}> <VirtualHost *:{{ keystone_admin_listen_port }}>
WSGIDaemonProcess keystone-admin processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }} WSGIDaemonProcess keystone-admin processes={{ openstack_service_workers }} threads=1 user=keystone group=keystone display-name=%{GROUP} python-path={{ python_path }}
WSGIProcessGroup keystone-admin WSGIProcessGroup keystone-admin
WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-admin WSGIScriptAlias / {{ binary_path }}/keystone-wsgi-admin