From 76b6d41e51f94361692db2b074ccc7907bab3070 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Thu, 27 Dec 2018 14:05:41 -0500 Subject: [PATCH] Allow designate services to use independent hostnames This allows designate service endpoints to use custom hostnames, and adds the following variables: * designate_internal_fqdn * designate_external_fqdn These default to the old values of kolla_internal_fqdn or kolla_external_fqdn. This also adds a designate_api_listen_port option, which defaults to designate_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: I654bb3d1109b96cbaff6f450655cd65f349a94e6 Implements: blueprint service-hostnames --- ansible/group_vars/all.yml | 3 +++ ansible/roles/designate/defaults/main.yml | 8 +++++--- ansible/roles/designate/tasks/precheck.yml | 2 +- ansible/roles/designate/templates/designate.conf.j2 | 4 ++-- ansible/roles/neutron/templates/neutron.conf.j2 | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 4d507c087e..5dcebc7cfe 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -201,7 +201,10 @@ cloudkitty_api_port: "8889" collectd_udp_port: "25826" +designate_internal_fqdn: "{{ kolla_internal_fqdn }}" +designate_external_fqdn: "{{ kolla_external_fqdn }}" designate_api_port: "9001" +designate_api_listen_port: "{{ designate_api_port }}" designate_bind_port: "53" designate_mdns_port: "{{ '53' if designate_backend == 'infoblox' else '5354' }}" designate_rndc_port: "953" diff --git a/ansible/roles/designate/defaults/main.yml b/ansible/roles/designate/defaults/main.yml index 435ba663f5..f88c916bf6 100644 --- a/ansible/roles/designate/defaults/main.yml +++ b/ansible/roles/designate/defaults/main.yml @@ -19,11 +19,13 @@ designate_services: mode: "http" external: false port: "{{ designate_api_port }}" + listen_port: "{{ designate_api_listen_port }}" designate_api_external: enabled: "{{ enable_designate }}" mode: "http" external: true port: "{{ designate_api_port }}" + listen_port: "{{ designate_api_listen_port }}" designate-backend-bind9: container_name: designate_backend_bind9 group: designate-backend-bind9 @@ -149,9 +151,9 @@ designate_sink_dimensions: "{{ default_container_dimensions }}" #################### # OpenStack #################### -designate_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ designate_api_port }}" -designate_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ designate_api_port }}" -designate_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ designate_api_port }}" +designate_admin_endpoint: "{{ admin_protocol }}://{{ designate_internal_fqdn }}:{{ designate_api_port }}" +designate_internal_endpoint: "{{ internal_protocol }}://{{ designate_internal_fqdn }}:{{ designate_api_port }}" +designate_public_endpoint: "{{ public_protocol }}://{{ designate_external_fqdn }}:{{ designate_api_port }}" designate_logging_debug: "{{ openstack_logging_debug }}" diff --git a/ansible/roles/designate/tasks/precheck.yml b/ansible/roles/designate/tasks/precheck.yml index 8f9c54ff2a..626fc31500 100644 --- a/ansible/roles/designate/tasks/precheck.yml +++ b/ansible/roles/designate/tasks/precheck.yml @@ -10,7 +10,7 @@ - name: Checking free port for designate API wait_for: host: "{{ api_interface_address }}" - port: "{{ designate_api_port }}" + port: "{{ designate_api_listen_port }}" connect_timeout: 1 timeout: 1 state: stopped diff --git a/ansible/roles/designate/templates/designate.conf.j2 b/ansible/roles/designate/templates/designate.conf.j2 index 533744082b..97e90cfdb3 100644 --- a/ansible/roles/designate/templates/designate.conf.j2 +++ b/ansible/roles/designate/templates/designate.conf.j2 @@ -11,8 +11,8 @@ default_pool_id = {{ designate_pool_id }} workers = {{ openstack_service_workers }} [service:api] -listen = {{ api_interface_address }}:{{ designate_api_port }} -api_base_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ designate_api_port }} +listen = {{ api_interface_address }}:{{ designate_api_listen_port }} +api_base_uri = {{ internal_protocol }}://{{ designate_internal_fqdn }}:{{ designate_api_port }} enabled_extensions_v2 = 'quotas, reports' workers = {{ openstack_service_workers }} enable_host_header = True diff --git a/ansible/roles/neutron/templates/neutron.conf.j2 b/ansible/roles/neutron/templates/neutron.conf.j2 index 8f183732b0..1b3f2f4253 100644 --- a/ansible/roles/neutron/templates/neutron.conf.j2 +++ b/ansible/roles/neutron/templates/neutron.conf.j2 @@ -138,7 +138,7 @@ base_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ octavia_api_po {% if enable_designate | bool %} [designate] -url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ designate_api_port }}/v2 +url = {{ internal_protocol }}://{{ designate_internal_fqdn }}:{{ designate_api_port }}/v2 auth_uri = {{ keystone_internal_url }} auth_url = {{ keystone_admin_url }} auth_type = password