From a9059a0f90bd7e78ed4ceb48cca165bc42fe6b42 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 27 Jul 2016 17:32:40 +0200 Subject: [PATCH] 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 --- .../manifests/configure_default_route.pp | 51 +++++++++++++++++++ .../puppet/manifests/hiera_override.pp | 6 +++ deployment_tasks.yaml | 14 +++++ 3 files changed, 71 insertions(+) create mode 100644 deployment_scripts/puppet/manifests/configure_default_route.pp diff --git a/deployment_scripts/puppet/manifests/configure_default_route.pp b/deployment_scripts/puppet/manifests/configure_default_route.pp new file mode 100644 index 0000000..45c15e7 --- /dev/null +++ b/deployment_scripts/puppet/manifests/configure_default_route.pp @@ -0,0 +1,51 @@ +# Copyright 2016 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +notice('fuel-plugin-influxdb-grafana: configure_default_route.pp') + +$fuel_version = 0 + hiera('fuel_version') + +if $fuel_version < 9.0 { + # The code below is a copy-paste from configure_default_route.pp in + # fuel-library (branch stable/8.0) + # Unfortunately we have no way to do otherwise since we need to support both + # MOS 8 and MOS 9 + $network_scheme = hiera_hash('network_scheme', {}) + $management_vrouter_vip = hiera('management_vrouter_vip') + $management_role = 'management' + $fw_admin_role = 'fw-admin' + + if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) { + $ovs_datapath_package_name = 'kmod-openvswitch-lt' + } + + $use_ovs_dkms_datapath_module = $::l23_os ? { + /(?i:redhat7|centos7)/ => false, + default => true + } + class { 'l23network' : + use_ovs => hiera('use_ovs', false), + use_ovs_dkms_datapath_module => $use_ovs_dkms_datapath_module, + ovs_datapath_package_name => $ovs_datapath_package_name, + } + + $new_network_scheme = configure_default_route($network_scheme, $management_vrouter_vip, $fw_admin_role, $management_role ) + notice ($new_network_scheme) + + if !empty($new_network_scheme) { + prepare_network_config($new_network_scheme) + $sdn = generate_network_config() + notify {'SDN': message => $sdn } + } +} diff --git a/deployment_scripts/puppet/manifests/hiera_override.pp b/deployment_scripts/puppet/manifests/hiera_override.pp index 4b02642..3ef3c38 100644 --- a/deployment_scripts/puppet/manifests/hiera_override.pp +++ b/deployment_scripts/puppet/manifests/hiera_override.pp @@ -14,6 +14,8 @@ notice('fuel-plugin-elasticsearch-kibana: hiera_override.pp') +$fuel_version = 0 + hiera('fuel_version') + # Initialize network-related variables $network_scheme = hiera_hash('network_scheme') $network_metadata = hiera_hash('network_metadata') @@ -210,3 +212,7 @@ file { $hiera_file: ensure => file, content => $calculated_content, } + +if $fuel_version >= 9.0 { + class { '::osnailyfacter::netconfig::hiera_default_route' :} +} diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 8f3957f..eb05d0f 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -158,6 +158,20 @@ # Tasks defintions for the post-deployment ########################################## +# Configure the default gateway (required for MOS 8 only) +- id: elasticsearch-configure-default-route + type: puppet + version: 2.0.0 + role: [primary-elasticsearch_kibana, elasticsearch_kibana] + requires: [post_deployment_start] + required_for: [post_deployment_end] + parameters: + puppet_manifest: "puppet/manifests/configure_default_route.pp" + puppet_modules: /etc/puppet/modules + timeout: 120 + reexecute_on: + - deploy_changes + # In order to automatically import dashboards, it is mandatory to create and # configure the Kibana index before Kibana4 starts. This task is ran at post-deployment # stage because the index creation must occur when the Elasticsearch cluster is ready