From b6c31862af432c19d426a3b1893e9baf12507393 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 27 Dec 2018 14:18:28 -0500 Subject: [PATCH] Allow senlin services to use independent hostnames This allows senlin service endpoints to use custom hostnames, and adds the following variables: * senlin_internal_fqdn * senlin_external_fqdn These default to the old values of kolla_internal_fqdn or kolla_external_fqdn. This also adds a senlin_api_listen_port option, which defaults to senlin_api_port for backward compatibility. This option 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: I26e8cfdde54aaf0648473f54136cf5350f356917 Implements: blueprint service-hostnames --- ansible/group_vars/all.yml | 3 +++ ansible/roles/senlin/defaults/main.yml | 8 +++++--- ansible/roles/senlin/tasks/precheck.yml | 2 +- ansible/roles/senlin/templates/senlin.conf.j2 | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index f10e3aed5b..4944742987 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -360,7 +360,10 @@ sahara_api_port: "8386" searchlight_api_port: "9393" +senlin_internal_fqdn: "{{ kolla_internal_fqdn }}" +senlin_external_fqdn: "{{ kolla_external_fqdn }}" senlin_api_port: "8778" +senlin_api_listen_port: "{{ senlin_api_port }}" skydive_analyzer_port: "8085" skydive_agents_port: "8090" diff --git a/ansible/roles/senlin/defaults/main.yml b/ansible/roles/senlin/defaults/main.yml index eafd89c4f6..56c6cd9a5b 100644 --- a/ansible/roles/senlin/defaults/main.yml +++ b/ansible/roles/senlin/defaults/main.yml @@ -19,11 +19,13 @@ senlin_services: mode: "http" external: false port: "{{ senlin_api_port }}" + listen_port: "{{ senlin_api_listen_port }}" senlin_api_external: enabled: "{{ enable_senlin }}" mode: "http" external: true port: "{{ senlin_api_port }}" + listen_port: "{{ senlin_api_listen_port }}" senlin-engine: container_name: senlin_engine group: senlin-engine @@ -65,9 +67,9 @@ senlin_engine_dimensions: "{{ default_container_dimensions }}" #################### # OpenStack #################### -senlin_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ senlin_api_port }}" -senlin_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ senlin_api_port }}" -senlin_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ senlin_api_port }}" +senlin_admin_endpoint: "{{ admin_protocol }}://{{ senlin_internal_fqdn }}:{{ senlin_api_port }}" +senlin_internal_endpoint: "{{ internal_protocol }}://{{ senlin_internal_fqdn }}:{{ senlin_api_port }}" +senlin_public_endpoint: "{{ public_protocol }}://{{ senlin_external_fqdn }}:{{ senlin_api_port }}" senlin_logging_debug: "{{ openstack_logging_debug }}" diff --git a/ansible/roles/senlin/tasks/precheck.yml b/ansible/roles/senlin/tasks/precheck.yml index 9748a0dbfe..451f85e0b4 100644 --- a/ansible/roles/senlin/tasks/precheck.yml +++ b/ansible/roles/senlin/tasks/precheck.yml @@ -8,7 +8,7 @@ - name: Checking free port for Senlin API wait_for: host: "{{ api_interface_address }}" - port: "{{ senlin_api_port }}" + port: "{{ senlin_api_listen_port }}" connect_timeout: 1 timeout: 1 state: stopped diff --git a/ansible/roles/senlin/templates/senlin.conf.j2 b/ansible/roles/senlin/templates/senlin.conf.j2 index 514597d0c5..48604fd73c 100644 --- a/ansible/roles/senlin/templates/senlin.conf.j2 +++ b/ansible/roles/senlin/templates/senlin.conf.j2 @@ -12,7 +12,7 @@ transport_url = {{ rpc_transport_url }} {% if service_name == 'senlin-api' %} [senlin_api] bind_host = {{ api_interface_address }} -bind_port = {{ senlin_api_port }} +bind_port = {{ senlin_api_listen_port }} workers = {{ openstack_service_workers }} {% endif %}