Browse Source

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
Mohammed Naser 6 months ago
parent
commit
fbdcdbd19c
2 changed files with 11 additions and 0 deletions
  1. 5
    0
      defaults/main.yml
  2. 6
    0
      templates/magnum.conf.j2

+ 5
- 0
defaults/main.yml View File

@@ -42,7 +42,12 @@ magnum_service_project_name: service
42 42
 magnum_service_role_names:
43 43
   - admin
44 44
 magnum_service_region: RegionOne
45
+magnum_barbican_service_region: "{{ magnum_service_region }}"
45 46
 magnum_cinder_service_region: "{{ magnum_service_region }}"
47
+magnum_glance_service_region: "{{ magnum_service_region }}"
48
+magnum_heat_service_region: "{{ magnum_service_region }}"
49
+magnum_neutron_service_region: "{{ magnum_service_region }}"
50
+magnum_nova_service_region: "{{ magnum_service_region }}"
46 51
 magnum_bind_port: 9511
47 52
 magnum_service_publicuri_proto: http
48 53
 magnum_service_publicurl: "{{ magnum_service_publicuri_proto }}://{{ external_lb_vip_address }}:{{ magnum_bind_port }}"

+ 6
- 0
templates/magnum.conf.j2 View File

@@ -14,6 +14,7 @@ host = {{ ansible_host }}
14 14
 send_cluster_metrics = False
15 15
 
16 16
 [barbican_client]
17
+region_name = {{ magnum_barbican_service_region }}
17 18
 endpoint_type = internalURL
18 19
 
19 20
 [cinder_client]
@@ -24,9 +25,11 @@ endpoint_type = internalURL
24 25
 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 %}
25 26
 
26 27
 [glance_client]
28
+region_name = {{ magnum_glance_service_region }}
27 29
 endpoint_type = internalURL
28 30
 
29 31
 [heat_client]
32
+region_name = {{ magnum_heat_service_region }}
30 33
 endpoint_type = internalURL
31 34
 
32 35
 [keystone_auth]
@@ -60,12 +63,15 @@ username = {{ magnum_service_user_name }}
60 63
 password = {{ magnum_service_password }}
61 64
 
62 65
 [magnum_client]
66
+region_name = {{ magnum_service_region }}
63 67
 endpoint_type = publicURL
64 68
 
65 69
 [neutron_client]
70
+region_name = {{ magnum_neutron_service_region }}
66 71
 endpoint_type = internalURL
67 72
 
68 73
 [nova_client]
74
+region_name = {{ magnum_nova_service_region }}
69 75
 endpoint_type = internalURL
70 76
 
71 77
 [oslo_messaging_notifications]

Loading…
Cancel
Save