From fbdcdbd19cc2b1b914adbca82a8b152f32189851 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Tue, 9 Oct 2018 06:33:18 +0200 Subject: [PATCH] Add multi-region support for Magnum Magnum currently tries to hit the first region that it finds so it can fail to deploy clusters in multi-region deployments non-determinsitically. This patch makes sure that the region can be configured and it defaults to the same one that Magnum is deployed on. Change-Id: I136ba0caead3a5afe11152aaed7bae94af8906b4 --- defaults/main.yml | 5 +++++ templates/magnum.conf.j2 | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 2e43ec2..b6e6a0a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -42,7 +42,12 @@ magnum_service_project_name: service magnum_service_role_names: - admin magnum_service_region: RegionOne +magnum_barbican_service_region: "{{ magnum_service_region }}" magnum_cinder_service_region: "{{ magnum_service_region }}" +magnum_glance_service_region: "{{ magnum_service_region }}" +magnum_heat_service_region: "{{ magnum_service_region }}" +magnum_neutron_service_region: "{{ magnum_service_region }}" +magnum_nova_service_region: "{{ magnum_service_region }}" magnum_bind_port: 9511 magnum_service_publicuri_proto: http magnum_service_publicurl: "{{ magnum_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ magnum_bind_port }}" diff --git a/templates/magnum.conf.j2 b/templates/magnum.conf.j2 index 7dbe2b9..675300d 100644 --- a/templates/magnum.conf.j2 +++ b/templates/magnum.conf.j2 @@ -14,6 +14,7 @@ host = {{ ansible_host }} send_cluster_metrics = False [barbican_client] +region_name = {{ magnum_barbican_service_region }} endpoint_type = internalURL [cinder_client] @@ -24,9 +25,11 @@ endpoint_type = internalURL connection = mysql+pymysql://{{ magnum_galera_user }}:{{ magnum_galera_password }}@{{ magnum_galera_address }}/{{ magnum_galera_database_name }}?charset=utf8{% if magnum_galera_use_ssl | bool %}&ssl_ca={{ magnum_galera_ssl_ca_cert }}{% endif %} [glance_client] +region_name = {{ magnum_glance_service_region }} endpoint_type = internalURL [heat_client] +region_name = {{ magnum_heat_service_region }} endpoint_type = internalURL [keystone_auth] @@ -60,12 +63,15 @@ username = {{ magnum_service_user_name }} password = {{ magnum_service_password }} [magnum_client] +region_name = {{ magnum_service_region }} endpoint_type = publicURL [neutron_client] +region_name = {{ magnum_neutron_service_region }} endpoint_type = internalURL [nova_client] +region_name = {{ magnum_nova_service_region }} endpoint_type = internalURL [oslo_messaging_notifications]