From 001dc03a0691bb3c94570d447584eea7e12264dc Mon Sep 17 00:00:00 2001 From: Michael Polenchuk Date: Fri, 3 Feb 2017 18:45:51 +0400 Subject: [PATCH] Skip creating non-existing resources Skip creating overridden neutron resources for odl controller in standalone mode. Change-Id: I429ff55e49744b84e6132412ed379b7a6a37ee14 --- .../parser/functions/odl_hiera_overrides.rb | 15 +++++++++------ .../opendaylight/manifests/hiera_override.pp | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/deployment_scripts/puppet/modules/opendaylight/lib/puppet/parser/functions/odl_hiera_overrides.rb b/deployment_scripts/puppet/modules/opendaylight/lib/puppet/parser/functions/odl_hiera_overrides.rb index d495a7c..e69a9b5 100644 --- a/deployment_scripts/puppet/modules/opendaylight/lib/puppet/parser/functions/odl_hiera_overrides.rb +++ b/deployment_scripts/puppet/modules/opendaylight/lib/puppet/parser/functions/odl_hiera_overrides.rb @@ -1,9 +1,9 @@ require 'yaml' module Puppet::Parser::Functions - newfunction(:odl_hiera_overrides, :type => :rvalue, :arity => 5) do |args| + newfunction(:odl_hiera_overrides, :type => :rvalue, :arity => 6) do |args| - odl, neutron_config, neutron_advanced_configuration, network_scheme, mgmt_vip = args + odl, neutron_config, neutron_advanced_configuration, network_scheme, mgmt_vip, standalone_mode = args hiera_overrides = {} configuration = {} @@ -56,10 +56,13 @@ module Puppet::Parser::Functions } } - configuration.merge! ml2_plugin - configuration.merge! l3_agent - configuration.merge! dhcp_agent - configuration.merge! neutron_ovs_config + unless standalone_mode + configuration.merge! ml2_plugin + configuration.merge! l3_agent + configuration.merge! dhcp_agent + configuration.merge! neutron_ovs_config + end + hiera_overrides['configuration'] = configuration hiera_overrides['configuration_options'] = { 'create' => false } diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/hiera_override.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/hiera_override.pp index 483652a..d9b13b5 100644 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/hiera_override.pp +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/hiera_override.pp @@ -6,13 +6,15 @@ class opendaylight::hiera_override { $orig_network_scheme = hiera_hash('network_scheme') $network_scheme = odl_network_scheme($opendaylight::odl_settings['enable_bgpvpn'], $orig_network_scheme) $ovsdb_managers = odl_ovsdb_managers($opendaylight::odl_mgmt_ips) + $standalone_mode = roles_include(['opendaylight']) and size(hiera('roles')) == 1 $odl_hiera_yaml = odl_hiera_overrides( $opendaylight::odl_settings, hiera('neutron_config'), hiera('neutron_advanced_configuration'), $network_scheme, - hiera('management_vip') + hiera('management_vip'), + $standalone_mode ) file { $override_file: