Add support for Fuel 10

* Make hiera override functionality reenterant.
  Change default behaviour (do not create them) of resource overrides.
  Produce override with resource creation during ML2 plugin configuration.

* Instead of writing file in odl_hiera_overrides(), return yaml data and
  write it using puppet file resource.

* Neutron dhcp agent reset ovs manager setting. Add one more input
  argument to `odl_hiera_overrides' function that configure
  `ovsdb_connection' in neutron.conf. This way ovsdb manager will be set
  correctly.

* Change `primary-openstack-network-plugins-l2' deployment task placement in deployment
  graph. Make it appear before
  `primary-openstack-network-server-config'. Otherwise we will try to
  start neutron-server prior to `neutron-server' .deb package
  installation.

* Switch `ovsdb_interface' to `vsctl' for both l3 and dhcp agents in
  neutron.conf, instead of writing it in two files (l3_agent.ini and
  dhcp_agent.ini).

Change-Id: I8ccb4bfe8e788cd171bafde125903d91aa31b59e
Partial-bug: 1648349
This commit is contained in:
Igor Zinovik 2016-12-30 15:03:30 +03:00
parent 0574e57f39
commit 581fcf5c41
5 changed files with 59 additions and 15 deletions

View File

@ -3,6 +3,15 @@ notice('MODULAR: odl-ml2.pp')
class neutron {}
class { 'neutron' :}
$override_configuration = hiera_hash(configuration, {})
$override_configuration_options = { create => true }
override_resources { 'odl-ml2-override':
configuration => $override_configuration,
options => $override_configuration_options,
}
include ::neutron::params
$node_name = hiera('node_name')
@ -36,6 +45,9 @@ $auth_endpoint_type = 'internalURL'
# Synchronize database after plugin was configured
if $primary_controller {
include ::neutron::db::sync
Override_resources['odl-ml2-override'] -> Exec['neutron-db-sync']
notify{"Trigger neutron-db-sync": } ~> Exec['neutron-db-sync']
}

View File

@ -0,0 +1,5 @@
notice('MODULAR: remove-odl-override.pp')
file { '/etc/hiera/plugins/opendaylight.yaml':
ensure => absent,
}

View File

@ -1,9 +1,9 @@
require 'yaml'
module Puppet::Parser::Functions
newfunction(:odl_hiera_overrides, :arity => 6) do |args|
newfunction(:odl_hiera_overrides, :type => :rvalue, :arity => 5) do |args|
filename, odl, neutron_config, neutron_advanced_configuration, network_scheme, mgmt_vip = args
odl, neutron_config, neutron_advanced_configuration, network_scheme, mgmt_vip = args
hiera_overrides = {}
configuration = {}
@ -26,8 +26,7 @@ module Puppet::Parser::Functions
# Must be changed before that!
l3_agent = {
'neutron_l3_agent_config' => {
'DEFAULT/external_network_bridge' => {'value' => 'br-ex'},
'ovs/ovsdb_interface' => {'value' => 'vsctl'}
'DEFAULT/external_network_bridge' => {'value' => 'br-ex'}
}
}
@ -40,15 +39,22 @@ module Puppet::Parser::Functions
# https://bugs.launchpad.net/neutron/+bug/1614766
dhcp_agent = {
'neutron_dhcp_agent_config' => {
'DEFAULT/force_metadata' => {'value' => true},
'ovs/ovsdb_interface' => {'value' => 'vsctl'}
'DEFAULT/force_metadata' => {'value' => true}
}
}
neutron_ovs_config = {
'neutron_config' => {
'OVS/ovsdb_interface' => {'value' => 'vsctl'}
}
}
configuration.merge! ml2_plugin
configuration.merge! l3_agent
configuration.merge! dhcp_agent
configuration.merge! neutron_ovs_config
hiera_overrides['configuration'] = configuration
hiera_overrides['configuration_options'] = { 'create' => false }
# override neutron_config/quantum_settings
neutron_config['L2']['mechanism_drivers'] = 'opendaylight'
@ -64,7 +70,7 @@ module Puppet::Parser::Functions
hiera_overrides['neutron_advanced_configuration'] = neutron_advanced_configuration
hiera_overrides['network_scheme'] = network_scheme
# write to hiera override yaml file
File.open(filename, 'w') { |file| file.write(hiera_overrides.to_yaml) }
return hiera_overrides.to_yaml
end
end

View File

@ -5,13 +5,20 @@ class opendaylight::hiera_override {
# override network scheme
$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)
odl_hiera_overrides(
$override_file,
$odl_hiera_yaml = odl_hiera_overrides(
$opendaylight::odl_settings,
hiera('neutron_config'),
hiera('neutron_advanced_configuration'),
$network_scheme,
hiera('management_vip')
)
file { $override_file:
ensure => present,
owner => 'root',
group => 'root',
content => $odl_hiera_yaml,
}
}

View File

@ -22,16 +22,30 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 720
- id: hiera-override
# We remove override file, because 'odl_hiera_override' task is not reenterant and
# cannot correctly handled data on subsequent calls
- id: odl_remove_hiera
type: puppet
version: 2.1.0
groups: [primary-controller, controller, compute, opendaylight]
required_for: [odl_hiera_override]
condition:
yaql_exp: &hiera_override >
changedAny($.network_metadata.vips.get('management'), $.quantum_settings,
$.opendaylight, $.neutron_advanced_configuration)
parameters:
puppet_manifest: puppet/manifests/remove-odl-override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 30
- id: odl_hiera_override
type: puppet
groups: [primary-controller, controller, compute, opendaylight]
version: 2.1.0
required_for: [netconfig]
requires: [globals]
condition:
yaql_exp: >
changedAny($.network_metadata.vips.get('management'), $.quantum_settings,
$.opendaylight, $.neutron_advanced_configuration)
yaql_exp: *hiera_override
parameters:
puppet_manifest: puppet/manifests/hiera-override.pp
puppet_modules: puppet/modules:/etc/puppet/modules
@ -104,7 +118,7 @@
version: 2.1.0
groups: [primary-controller]
required_for: [openstack-network-end]
requires: [openstack-network-start, openstack-network-common-config, openstack-network-server-config]
requires: [openstack-network-start, openstack-network-common-config, primary-openstack-network-server-config]
condition:
yaql_exp: &network_plugins_l2 >
changedAny($.quantum, $.configuration, $.fqdn,