Browse Source

Configure the management gateway on the nodes

Without this change, the nodes are configured to use the Fuel node as
their default gateway. Note that the code path is different between MOS
8 and MOS 9 because of this bug fix [1] that hasn't been backported on
MOS 8.

[1] https://bugs.launchpad.net/fuel/+bug/1541309

Change-Id: I80a2fadf8b16b139d07c48a33c52efd33c66935f
Closes-Bug: #1583994
tags/1.0rc1
Simon Pasquier 2 years ago
parent
commit
a9059a0f90

+ 51
- 0
deployment_scripts/puppet/manifests/configure_default_route.pp View File

@@ -0,0 +1,51 @@
1
+# Copyright 2016 Mirantis, Inc.
2
+#
3
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
4
+# not use this file except in compliance with the License. You may obtain
5
+# a copy of the License at
6
+#
7
+#      http://www.apache.org/licenses/LICENSE-2.0
8
+#
9
+# Unless required by applicable law or agreed to in writing, software
10
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+# License for the specific language governing permissions and limitations
13
+# under the License.
14
+
15
+notice('fuel-plugin-influxdb-grafana: configure_default_route.pp')
16
+
17
+$fuel_version = 0 + hiera('fuel_version')
18
+
19
+if $fuel_version < 9.0 {
20
+  # The code below is a copy-paste from configure_default_route.pp in
21
+  # fuel-library (branch stable/8.0)
22
+  # Unfortunately we have no way to do otherwise since we need to support both
23
+  # MOS 8 and MOS 9
24
+  $network_scheme         = hiera_hash('network_scheme', {})
25
+  $management_vrouter_vip = hiera('management_vrouter_vip')
26
+  $management_role        = 'management'
27
+  $fw_admin_role          = 'fw-admin'
28
+
29
+  if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) {
30
+    $ovs_datapath_package_name = 'kmod-openvswitch-lt'
31
+  }
32
+
33
+  $use_ovs_dkms_datapath_module = $::l23_os ? {
34
+                                    /(?i:redhat7|centos7)/ => false,
35
+                                    default                => true
36
+                                  }
37
+  class { 'l23network' :
38
+    use_ovs                      => hiera('use_ovs', false),
39
+    use_ovs_dkms_datapath_module => $use_ovs_dkms_datapath_module,
40
+    ovs_datapath_package_name    => $ovs_datapath_package_name,
41
+  }
42
+
43
+  $new_network_scheme = configure_default_route($network_scheme, $management_vrouter_vip, $fw_admin_role, $management_role )
44
+  notice ($new_network_scheme)
45
+
46
+  if !empty($new_network_scheme) {
47
+    prepare_network_config($new_network_scheme)
48
+    $sdn = generate_network_config()
49
+    notify {'SDN': message => $sdn }
50
+  }
51
+}

+ 6
- 0
deployment_scripts/puppet/manifests/hiera_override.pp View File

@@ -14,6 +14,8 @@
14 14
 
15 15
 notice('fuel-plugin-elasticsearch-kibana: hiera_override.pp')
16 16
 
17
+$fuel_version = 0 + hiera('fuel_version')
18
+
17 19
 # Initialize network-related variables
18 20
 $network_scheme   = hiera_hash('network_scheme')
19 21
 $network_metadata = hiera_hash('network_metadata')
@@ -210,3 +212,7 @@ file { $hiera_file:
210 212
   ensure  => file,
211 213
   content => $calculated_content,
212 214
 }
215
+
216
+if $fuel_version >= 9.0 {
217
+    class { '::osnailyfacter::netconfig::hiera_default_route' :}
218
+}

+ 14
- 0
deployment_tasks.yaml View File

@@ -158,6 +158,20 @@
158 158
 # Tasks defintions for the post-deployment
159 159
 ##########################################
160 160
 
161
+# Configure the default gateway (required for MOS 8 only)
162
+- id: elasticsearch-configure-default-route
163
+  type: puppet
164
+  version: 2.0.0
165
+  role: [primary-elasticsearch_kibana, elasticsearch_kibana]
166
+  requires: [post_deployment_start]
167
+  required_for: [post_deployment_end]
168
+  parameters:
169
+    puppet_manifest: "puppet/manifests/configure_default_route.pp"
170
+    puppet_modules: /etc/puppet/modules
171
+    timeout: 120
172
+  reexecute_on:
173
+    - deploy_changes
174
+
161 175
 # In order to automatically import dashboards, it is mandatory to create and
162 176
 # configure the Kibana index before Kibana4 starts. This task is ran at post-deployment
163 177
 # stage because the index creation must occur when the Elasticsearch cluster is ready

Loading…
Cancel
Save