From 55702739d04cd16a2774179267e1c4d79dc8a4ae Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 27 Dec 2018 14:15:48 -0500 Subject: [PATCH] Allow octavia services to use independent hostnames This allows octavia service endpoints to use custom hostnames, and adds the following variables: * octavia_internal_fqdn * octavia_external_fqdn These default to the old values of kolla_internal_fqdn or kolla_external_fqdn. This also adds a octavia_api_listen_port option, which defaults to octavia_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: I1310eb5573a469b1a0e9549e853734455307a8b3 Implements: blueprint service-hostnames --- ansible/group_vars/all.yml | 3 +++ ansible/roles/neutron/templates/neutron.conf.j2 | 2 +- ansible/roles/octavia/defaults/main.yml | 6 +++--- ansible/roles/octavia/tasks/precheck.yml | 2 +- ansible/roles/octavia/templates/octavia.conf.j2 | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 6207834fe7..f10e3aed5b 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -306,7 +306,10 @@ nova_serialproxy_fqdn: "{{ kolla_external_fqdn }}" nova_serialproxy_port: "6083" nova_serialproxy_listen_port: "{{ nova_serialproxy_port }}" +octavia_internal_fqdn: "{{ kolla_internal_fqdn }}" +octavia_external_fqdn: "{{ kolla_external_fqdn }}" octavia_api_port: "9876" +octavia_api_listen_port: "{{ octavia_api_port }}" octavia_health_manager_port: "5555" outward_rabbitmq_port: "5674" diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index 1b3f2f4253..79f0a911d7 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -133,7 +133,7 @@ drivers = ovs {% if enable_octavia | bool %} [octavia] -base_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ octavia_api_port }} +base_url = {{ internal_protocol }}://{{ octavia_internal_fqdn }}:{{ octavia_api_port }} {% endif %} {% if enable_designate | bool %} diff --git a/ansible/roles/octavia/defaults/main.yml b/ansible/roles/octavia/defaults/main.yml index 753dbf9563..3ec8162564 100644 --- a/ansible/roles/octavia/defaults/main.yml +++ b/ansible/roles/octavia/defaults/main.yml @@ -101,9 +101,9 @@ octavia_worker_dimensions: "{{ default_container_dimensions }}" #################### # OpenStack #################### -octavia_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ octavia_api_port }}" -octavia_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ octavia_api_port }}" -octavia_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ octavia_api_port }}" +octavia_admin_endpoint: "{{ admin_protocol }}://{{ octavia_internal_fqdn }}:{{ octavia_api_port }}" +octavia_internal_endpoint: "{{ internal_protocol }}://{{ octavia_internal_fqdn }}:{{ octavia_api_port }}" +octavia_public_endpoint: "{{ public_protocol }}://{{ octavia_external_fqdn }}:{{ octavia_api_port }}" octavia_logging_debug: "{{ openstack_logging_debug }}" diff --git a/ansible/roles/octavia/tasks/precheck.yml b/ansible/roles/octavia/tasks/precheck.yml index 9aa417b9c8..3815736181 100644 --- a/ansible/roles/octavia/tasks/precheck.yml +++ b/ansible/roles/octavia/tasks/precheck.yml @@ -9,7 +9,7 @@ - name: Checking free port for Octavia API wait_for: host: "{{ api_interface_address }}" - port: "{{ octavia_api_port }}" + port: "{{ octavia_api_listen_port }}" connect_timeout: 1 timeout: 1 state: stopped diff --git a/ansible/roles/octavia/templates/octavia.conf.j2 b/ansible/roles/octavia/templates/octavia.conf.j2 index 7e355951fc..09d828c91f 100644 --- a/ansible/roles/octavia/templates/octavia.conf.j2 +++ b/ansible/roles/octavia/templates/octavia.conf.j2 @@ -7,7 +7,7 @@ transport_url = {{ rpc_transport_url }} [api_settings] bind_host = {{ api_interface_address }} -bind_port = {{ octavia_api_port }} +bind_port = {{ octavia_api_listen_port }} [certificates] ca_private_key_passphrase = {{ octavia_ca_password }}