Fuel plugin to install NSXv with Neutron UI in wizard
* Plugin removes restriction on 'Neutron with tunnelling' in cluster creation wizard * Plugin ships two .deb packages: python-vmware-nsx - Neutron NSXv plugin python-nova - Nova package with NSXv support in nova-compute https://review.openstack.org/#/c/209372/ https://review.openstack.org/#/c/209374/ For build plugin need fpb version 3. Change-Id: If6ba42abd7aaabca7a02c45718a82c6f8ca1e5a2
This commit is contained in:
parent
08a26260e2
commit
733daf12f9
|
@ -0,0 +1,35 @@
|
|||
Fuel NSXv plugin
|
||||
================
|
||||
|
||||
Fuel NSXv plugin enables OpenStack deployment which utilizes vCenter with
|
||||
installed and configured VMware NSXv network virtualization software.
|
||||
|
||||
Supported features:
|
||||
- VM port provisioning
|
||||
- Security groups
|
||||
|
||||
How to build plugin:
|
||||
|
||||
* Install fuel plugin builder:
|
||||
|
||||
..
|
||||
pip install fuel-plugin-builder
|
||||
|
||||
* Clone plugin source repository
|
||||
|
||||
..
|
||||
git clone https://github.com/stackforge/fuel-plugin-nsxv
|
||||
|
||||
cd fuel-plugin-nsxv/
|
||||
|
||||
fpb --build .
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
* Upload the plugin to Fuel master node
|
||||
|
||||
* Install the plugin using Fuel command line client:
|
||||
|
||||
..
|
||||
fuel plugins --install nsxv-1.0-1.0.0-1.noarch.rpm
|
|
@ -0,0 +1,3 @@
|
|||
notice('fuel-plugin-nsxv: compute_vmware_nova_config.pp')
|
||||
|
||||
class { '::nsxv::compute_vmware_nova_config': }
|
|
@ -0,0 +1,3 @@
|
|||
notice('fuel-plugin-nsxv: haproxy-nova-metadata-config.pp')
|
||||
|
||||
class { 'nsxv::haproxy_nova_metadata_config': }
|
|
@ -1,3 +1,5 @@
|
|||
notice('fuel-plugin-nsxv: hiera-override.pp')
|
||||
|
||||
class { '::nsxv::hiera_override': }
|
||||
class { '::nsxv::hiera_override':
|
||||
plugin_name => "NAME",
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
notice('fuel-plugin-nsxv: patch-neutron-manifest.pp')
|
||||
|
||||
class { '::nsxv::patch_neutron_manifest': }
|
|
@ -1,6 +1,7 @@
|
|||
notice('fuel-plugin-nsxv: repo-priority.pp')
|
||||
|
||||
# Values are changed by pre_build_hook
|
||||
class { '::nsxv::repo_priority':
|
||||
plugin_name => "nsxv",
|
||||
plugin_version => "1.0.0",
|
||||
plugin_name => "NAME",
|
||||
plugin_version => "VERSION",
|
||||
}
|
||||
|
|
|
@ -0,0 +1,142 @@
|
|||
notice('MODULAR: openstack-network-controller.pp(fuel-plugin-nsxv patch)')
|
||||
|
||||
$core_plugin = 'vmware_nsx.neutron.plugins.vmware.plugin.NsxVPlugin'
|
||||
$policy_file = '/etc/neutron/policy.json'
|
||||
|
||||
$neutron_config = hiera_hash('quantum_settings')
|
||||
$rabbit_hash = hiera_hash('rabbit_hash', {})
|
||||
$ceilometer_hash = hiera('ceilometer',{})
|
||||
$nova_hash = hiera_hash('nova', {})
|
||||
$network_scheme = hiera('network_scheme', {})
|
||||
|
||||
prepare_network_config($network_scheme)
|
||||
|
||||
# Neutron DB settings
|
||||
$neutron_db_password = $neutron_config['database']['passwd']
|
||||
$neutron_db_user = pick($neutron_config['database']['user'], 'neutron')
|
||||
$neutron_db_name = pick($neutron_config['database']['name'], 'neutron')
|
||||
$neutron_db_host = pick($neutron_config['database']['host'], hiera('database_vip'))
|
||||
$neutron_db_uri = "mysql://${neutron_db_user}:${neutron_db_password}@${neutron_db_host}/${neutron_db_name}?&read_timeout=60"
|
||||
|
||||
# Neutron Keystone settings
|
||||
$neutron_user_password = $neutron_config['keystone']['admin_password']
|
||||
$keystone_user = pick($neutron_config['keystone']['admin_user'], 'neutron')
|
||||
$keystone_tenant = pick($neutron_config['keystone']['admin_tenant'], 'services')
|
||||
|
||||
# base
|
||||
$neutron_local_address_for_bind = get_network_role_property('neutron/api', 'ipaddr') # prepare_network_config need
|
||||
$region = hiera('region', 'RegionOne')
|
||||
$management_vip = hiera('management_vip')
|
||||
$service_workers = pick($neutron_config['workers'], min(max($::processorcount, 2), 16))
|
||||
|
||||
# endpoints
|
||||
$service_endpoint = hiera('service_endpoint')
|
||||
$nova_endpoint = hiera('nova_endpoint', $management_vip)
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
|
||||
# logs
|
||||
$debug = hiera('debug', true)
|
||||
$use_syslog = hiera('use_syslog', true)
|
||||
$use_stderr = hiera('use_stderr', false)
|
||||
$syslog_log_facility_neutron = hiera('syslog_log_facility_neutron', 'LOG_LOCAL4')
|
||||
|
||||
# Queue settings
|
||||
$queue_provider = hiera('queue_provider', 'rabbitmq')
|
||||
$amqp_hosts = split(hiera('amqp_hosts', ''), ',')
|
||||
|
||||
class { 'l23network' :
|
||||
use_ovs => false
|
||||
}
|
||||
|
||||
include ::nova::params
|
||||
service { 'nova-api':
|
||||
ensure => 'running',
|
||||
name => $::nova::params::api_service_name,
|
||||
}
|
||||
Nova_config<| |> ~> Service['nova-api']
|
||||
|
||||
class { 'openstack::network':
|
||||
network_provider => 'neutron',
|
||||
agents => [],
|
||||
ha_agents => false,
|
||||
verbose => true,
|
||||
debug => $debug,
|
||||
use_syslog => $use_syslog,
|
||||
use_stderr => $use_stderr,
|
||||
syslog_log_facility => $syslog_log_facility_neutron,
|
||||
|
||||
neutron_server => true,
|
||||
neutron_server_enable => true,
|
||||
neutron_db_uri => $neutron_db_uri,
|
||||
nova_neutron => true,
|
||||
base_mac => undef,
|
||||
core_plugin => $core_plugin,
|
||||
service_plugins => [],
|
||||
net_mtu => undef,
|
||||
network_device_mtu => undef,
|
||||
bind_host => $neutron_local_address_for_bind,
|
||||
dvr => false,
|
||||
l2_population => false,
|
||||
service_workers => $service_workers,
|
||||
|
||||
#ovs
|
||||
mechanism_drivers => undef,
|
||||
local_ip => undef,
|
||||
bridge_mappings => undef,
|
||||
network_vlan_ranges => undef,
|
||||
enable_tunneling => undef,
|
||||
tunnel_id_ranges => undef,
|
||||
vni_ranges => undef,
|
||||
tunnel_types => undef,
|
||||
tenant_network_types => undef,
|
||||
|
||||
floating_bridge => undef,
|
||||
|
||||
#Queue settings
|
||||
queue_provider => $queue_provider,
|
||||
amqp_hosts => $amqp_hosts,
|
||||
|
||||
amqp_user => $rabbit_hash['user'],
|
||||
amqp_password => $rabbit_hash['password'],
|
||||
|
||||
# keystone
|
||||
admin_password => $neutron_user_password,
|
||||
auth_url => "http://${service_endpoint}:35357/v2.0",
|
||||
identity_uri => "http://${service_endpoint}:35357",
|
||||
neutron_url => "http://${neutron_endpoint}:9696",
|
||||
admin_tenant_name => $keystone_tenant,
|
||||
admin_username => $keystone_user,
|
||||
region => $region,
|
||||
|
||||
# Ceilometer notifications
|
||||
ceilometer => $ceilometer_hash['enabled'],
|
||||
|
||||
#metadata
|
||||
shared_secret => undef,
|
||||
metadata_ip => undef,
|
||||
isolated_metadata => undef,
|
||||
|
||||
#nova settings
|
||||
private_interface => undef,
|
||||
public_interface => undef,
|
||||
fixed_range => undef,
|
||||
floating_range => undef,
|
||||
network_manager => undef,
|
||||
network_config => undef,
|
||||
create_networks => undef,
|
||||
num_networks => undef,
|
||||
network_size => undef,
|
||||
nameservers => undef,
|
||||
enable_nova_net => undef,
|
||||
nova_admin_username => $nova_hash['user'],
|
||||
nova_admin_tenant_name => $nova_hash['tenant'],
|
||||
nova_admin_password => $nova_hash['user_password'],
|
||||
nova_url => "http://${nova_endpoint}:8774/v2",
|
||||
}
|
||||
file { "${policy_file}":
|
||||
ensure => file,
|
||||
source => 'file:///etc/puppet/files/policy.json',
|
||||
mode => 644,
|
||||
require => Class['openstack::network'],
|
||||
replace => true,
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
class nsxv::compute_vmware_nova_config (
|
||||
) {
|
||||
include ::nova::params
|
||||
|
||||
$neutron_config = hiera_hash('quantum_settings')
|
||||
$neutron_metadata_proxy_secret = $neutron_config['metadata']['metadata_proxy_shared_secret']
|
||||
$nova_parameters = {
|
||||
'neutron/service_metadata_proxy' => { value => 'True' },
|
||||
'neutron/metadata_proxy_shared_secret' => { value => "${neutron_metadata_proxy_secret}" }
|
||||
}
|
||||
|
||||
$management_vip = hiera('management_vip')
|
||||
$service_endpoint = hiera('service_endpoint')
|
||||
$neutron_endpoint = hiera('neutron_endpoint', $management_vip)
|
||||
$neutron_admin_username = pick($neutron_config['keystone']['admin_user'], 'neutron')
|
||||
$neutron_admin_password = $neutron_config['keystone']['admin_password']
|
||||
$neutron_admin_tenant_name = pick($neutron_config['keystone']['admin_tenant'], 'services')
|
||||
$neutron_admin_auth_url = "http://${service_endpoint}:35357/v2.0"
|
||||
$neutron_url = "http://${neutron_endpoint}:9696"
|
||||
$region = hiera('region', 'RegionOne')
|
||||
|
||||
class {'nova::network::neutron':
|
||||
neutron_admin_password => $neutron_admin_password,
|
||||
neutron_admin_tenant_name => $neutron_admin_tenant_name,
|
||||
neutron_region_name => $region,
|
||||
neutron_admin_username => $neutron_admin_username,
|
||||
neutron_admin_auth_url => $neutron_admin_auth_url,
|
||||
neutron_url => $neutron_url,
|
||||
neutron_ovs_bridge => '',
|
||||
}
|
||||
|
||||
create_resources(nova_config, $nova_parameters)
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
class nsxv::haproxy_nova_metadata_config (
|
||||
$metadata_ha_conf = '/etc/haproxy/conf.d/060-nova-metadata-api.cfg',
|
||||
) {
|
||||
$public_vip = hiera('public_vip')
|
||||
|
||||
file_line { 'metadata_public_listen':
|
||||
path => $metadata_ha_conf,
|
||||
after => 'listen nova-metadata-api',
|
||||
line => " bind ${public_vip}:8775",
|
||||
}
|
||||
}
|
|
@ -1,33 +1,52 @@
|
|||
class nsxv::hiera_override (
|
||||
$override_file = '/etc/hiera/override/plugins_nsxv.yaml',
|
||||
$neutron_bridge = 'br-mgmt',
|
||||
$plugin_name,
|
||||
) {
|
||||
$override_file = "/etc/hiera/override/${plugin_name}.yaml"
|
||||
$override_dir = dirname($override_file)
|
||||
|
||||
$network_roles_on_neutron_bridge = inline_template("<%-
|
||||
network_scheme = scope.function_hiera(['network_scheme'])
|
||||
roles = network_scheme['roles']
|
||||
-%>
|
||||
<%= roles.key(scope.lookupvar('neutron_bridge')) %>")
|
||||
|
||||
$network_scheme_patch = inline_template("<%-
|
||||
$quantum_settings = inline_template("<%-
|
||||
require 'yaml'
|
||||
network_scheme = {}
|
||||
network_scheme['network_scheme'] = scope.function_hiera(['network_scheme'])
|
||||
network_scheme['network_scheme']['roles']['neutron/api'] = scope.lookupvar('neutron_bridge')
|
||||
settings = scope.function_hiera(['quantum_settings'])
|
||||
settings['predefined_networks'] = {}
|
||||
quantum_settings = { 'quantum_settings' => settings }
|
||||
-%>
|
||||
<%= quantum_settings.to_yaml %>")
|
||||
|
||||
$network_metadata = inline_template("<%-
|
||||
require 'yaml'
|
||||
delete_roles = ['neutron/floating','neutron/mesh','neutron/private']
|
||||
network_metadata = { 'network_metadata' => scope.function_hiera(['network_metadata']) }
|
||||
nodes = network_metadata['network_metadata']['nodes']
|
||||
nodes.each do |node, meta|
|
||||
(nodes[node]['network_roles']).delete_if { | key, value | delete_roles.include?(key) }
|
||||
end
|
||||
-%>
|
||||
<%= network_metadata.to_yaml %>")
|
||||
|
||||
$network_scheme = inline_template("<%-
|
||||
require 'yaml'
|
||||
delete_bridges = ['br-mesh','br-floating']
|
||||
network_scheme = { 'network_scheme' => scope.function_hiera(['network_scheme']) }
|
||||
|
||||
transformations = network_scheme['network_scheme']['transformations']
|
||||
transformations.delete_if { |action| action['action'] == 'add-br' and delete_bridges.include?(action['name']) }
|
||||
transformations.delete_if { |action| action['action'] == 'add-patch' and not (action['bridges'] & delete_bridges).empty? }
|
||||
transformations.delete_if { |action| action['action'] == 'add-port' and delete_bridges.include?(action['bridge']) }
|
||||
|
||||
roles = network_scheme['network_scheme']['roles']
|
||||
roles.delete_if { |role, bridge| delete_bridges.include?(bridge) }
|
||||
|
||||
endpoints = network_scheme['network_scheme']['endpoints']
|
||||
endpoints.delete_if { |bridge, value| delete_bridges.include?(bridge) }
|
||||
-%>
|
||||
<%= network_scheme.to_yaml %>")
|
||||
|
||||
$neutron_nodes = inline_template("<%-
|
||||
require 'yaml'
|
||||
neutron_nodes = {}
|
||||
nodes = scope.function_hiera_hash(['neutron_nodes'])
|
||||
neutron_nodes['neutron_nodes'] = nodes
|
||||
nodes.each do |node, meta|
|
||||
neutron_nodes['neutron_nodes'][node]['network_roles']['neutron/api'] = neutron_nodes['neutron_nodes'][node]['network_roles'][(scope.lookupvar('network_roles_on_neutron_bridge')).strip]
|
||||
end
|
||||
$neutron_advanced_configuration = inline_template("<%-
|
||||
neutron_advanced_configuration = { 'neutron_advanced_configuration' => scope.function_hiera(['neutron_advanced_configuration']) }
|
||||
neutron_advanced_configuration['neutron_advanced_configuration']['neutron_dvr'] = false
|
||||
neutron_advanced_configuration['neutron_advanced_configuration']['neutron_l2_pop'] = false
|
||||
-%>
|
||||
<%= neutron_nodes.to_yaml %>")
|
||||
<%= neutron_advanced_configuration.to_yaml %>")
|
||||
|
||||
file { $override_dir:
|
||||
ensure => directory,
|
||||
|
@ -38,22 +57,34 @@ class nsxv::hiera_override (
|
|||
order => 'numeric',
|
||||
replace => true,
|
||||
}
|
||||
concat::fragment{ 'quantum_settings':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => $quantum_settings,
|
||||
order => '01'
|
||||
}
|
||||
concat::fragment{ 'network_metadata':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => regsubst($network_metadata,'---',''),
|
||||
order => '10'
|
||||
}
|
||||
concat::fragment{ 'network_scheme':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => $network_scheme_patch,
|
||||
order => '01'
|
||||
}
|
||||
concat::fragment{ 'neutron_nodes':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => regsubst($neutron_nodes,'---',''),
|
||||
order => '10'
|
||||
}
|
||||
concat::fragment{ 'use_neutron':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => " use_neutron: true",
|
||||
content => regsubst($network_scheme,'---',''),
|
||||
order => '20'
|
||||
}
|
||||
concat::fragment{ 'neutron_advanced_configuration':
|
||||
ensure => present,
|
||||
target => $override_file,
|
||||
content => regsubst($neutron_advanced_configuration,'---',''),
|
||||
order => '30'
|
||||
}
|
||||
|
||||
file_line {"${plugin_name}_hiera_override":
|
||||
path => '/etc/hiera.yaml',
|
||||
line => " - override/${plugin_name}",
|
||||
after => ' - override/module/%{calling_module}',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
class nsxv (
|
||||
$nsxv_config_dir = '/etc/neutron/plugins/vmware',
|
||||
$neutron_plugin_file = '/etc/neutron/plugin.ini',
|
||||
$neutron_plugin_name = 'python-vmware-nsx',
|
||||
) {
|
||||
|
||||
$quantum_settings = hiera('quantum_settings')
|
||||
|
||||
$settings = hiera('nsxv')
|
||||
|
@ -10,11 +13,6 @@ class nsxv (
|
|||
$nova_metadata_port = '8775'
|
||||
$metadata_shared_secret = $quantum_settings['metadata']['metadata_proxy_shared_secret']
|
||||
|
||||
$nsxv_config_dirs = [ '/etc/neutron', '/etc/neutron/plugins', '/etc/neutron/plugins/vmware' ]
|
||||
file { $nsxv_config_dirs:
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
if ! $settings['nsxv_insecure'] {
|
||||
$ca_certificate_content = $settings['nsxv_ca_file']['content']
|
||||
$ca_file = "${nsxv_config_dir}/ca.pem"
|
||||
|
@ -22,24 +20,28 @@ class nsxv (
|
|||
file { "${ca_file}":
|
||||
ensure => present,
|
||||
content => $ca_certificate_content,
|
||||
require => File[$nsxv_config_dirs],
|
||||
require => Exec['nsxv_config_dir'],
|
||||
}
|
||||
}
|
||||
|
||||
package { 'python-vmware-nsx':
|
||||
package { $neutron_plugin_name:
|
||||
ensure => latest,
|
||||
}
|
||||
|
||||
$nsxv_config_dirs = [ '/etc/neutron', '/etc/neutron/plugins', '/etc/neutron/plugins/vmware' ]
|
||||
file { $nsxv_config_dirs:
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
file { "${nsxv_config_dir}/nsx.ini":
|
||||
ensure => file,
|
||||
content => template("${module_name}/nsx.ini.erb"),
|
||||
require => File[$nsxv_config_dirs],
|
||||
}
|
||||
|
||||
file { '/etc/neutron/plugin.ini':
|
||||
file { $neutron_plugin_file:
|
||||
ensure => link,
|
||||
target => "${nsxv_config_dir}/nsx.ini",
|
||||
replace => true,
|
||||
require => File[$nsxv_config_dirs],
|
||||
require => File[$nsxv_config_dirs]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
class nsxv::patch_neutron_manifest (
|
||||
$manifest_file = '/etc/puppet/modules/osnailyfacter/modular/openstack-network/openstack-network-controller.pp',
|
||||
$policy_file = '/etc/puppet/files/policy.json',
|
||||
) {
|
||||
file { $manifest_file:
|
||||
ensure => file,
|
||||
source => "puppet:///modules/${module_name}/openstack-network-controller.pp",
|
||||
mode => 644,
|
||||
replace => true,
|
||||
}
|
||||
file { $policy_file:
|
||||
ensure => file,
|
||||
source => "puppet:///modules/${module_name}/policy.json",
|
||||
mode => 644,
|
||||
replace => true,
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
class nsxv::repo_priority (
|
||||
$plugin_name = 'nsxv',
|
||||
$plugin_version = '1.0.0',
|
||||
$plugin_name,
|
||||
$plugin_version,
|
||||
) {
|
||||
if $operatingsystem == 'Ubuntu' {
|
||||
include apt
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
- id: hiera-override
|
||||
type: puppet
|
||||
groups: ['primary-controller','controller','compute-vmware']
|
||||
required_for: [netconfig]
|
||||
requires: [globals]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/hiera-override.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 120
|
||||
- id: compute-vmware-nova-config
|
||||
type: puppet
|
||||
groups: ['compute-vmware']
|
||||
required_for: [top-role-compute-vmware]
|
||||
requires: [top-role-compute]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/compute-vmware-nova-config.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 300
|
||||
- id: openstack-haproxy-nova-metadata-public_vip
|
||||
type: puppet
|
||||
groups: ['primary-controller','controller']
|
||||
required_for: [openstack-haproxy]
|
||||
requires: [openstack-haproxy-nova]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/haproxy-nova-metadata-config.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 120
|
||||
- id: nsxv-install
|
||||
type: puppet
|
||||
groups: ['primary-controller','controller']
|
||||
required_for: [openstack-network]
|
||||
requires: [hiera-override]
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/nsxv-config.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 300
|
|
@ -104,19 +104,16 @@ attributes:
|
|||
weight: 65
|
||||
type: 'checkbox'
|
||||
nsxv_insecure:
|
||||
value: false
|
||||
label: 'Verify NSX Manager certificate'
|
||||
description: 'If true, the NSXv server certificate is not verified'
|
||||
value: true
|
||||
label: 'Bypass NSX Manager certificate verification'
|
||||
description: ''
|
||||
weight: 70
|
||||
type: 'checkbox'
|
||||
restrictions:
|
||||
- condition: 'settings:nsxv.nsxv_additional.value == false'
|
||||
action: 'hide'
|
||||
nsxv_ca_file:
|
||||
value: ''
|
||||
label: 'CA certificate file'
|
||||
description: 'Specify a CA certificate file to use in verifying NSX Manager certificate'
|
||||
weight: 71
|
||||
weight: 75
|
||||
type: 'file'
|
||||
restrictions:
|
||||
- condition: 'settings:nsxv.nsxv_insecure.value == true'
|
||||
|
|
|
@ -18,7 +18,7 @@ releases:
|
|||
repository_path: repositories/ubuntu
|
||||
|
||||
# Version of plugin package
|
||||
package_version: '2.0.0'
|
||||
package_version: '3.0.0'
|
||||
licenses: ['Apache 2.0']
|
||||
authors: ['Artem Savinov, Mirantis', 'Igor Zinovik, Mirantis']
|
||||
homepage: https://github.com/stackforge/fuel-plugin-nsxv
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
#!/bin/bash
|
||||
|
||||
CTL=$(which dockerctl)
|
||||
PATCH=$(which patch)
|
||||
TMPDIR=$(mktemp -d)
|
||||
CONTAINER='nailgun'
|
||||
|
||||
cat > $TMPDIR/patch.py << 'EOF'
|
||||
#!/usr/bin/env python
|
||||
|
||||
from nailgun.db.sqlalchemy.models import *
|
||||
from nailgun.db import db
|
||||
from copy import deepcopy
|
||||
|
||||
def clear_restriction():
|
||||
for release in db().query(Release).all():
|
||||
release.wizard_metadata = deepcopy(release.wizard_metadata)
|
||||
|
||||
for value in release.wizard_metadata['Network']['manager']['values']:
|
||||
try:
|
||||
if value['data'] == 'neutron-tun' and value['restrictions'][0].keys()[0] == 'Compute.vcenter == true':
|
||||
del value['restrictions']
|
||||
except:
|
||||
pass
|
||||
|
||||
for index, vcenter_settings in enumerate(release.wizard_metadata['Compute']['vcenter']['bind']):
|
||||
try:
|
||||
if 'wizard:Network.manager' in str(vcenter_settings):
|
||||
release.wizard_metadata['Compute']['vcenter']['bind'][index]['wizard:Network.manager'] = 'neutron-tun'
|
||||
except:
|
||||
pass
|
||||
|
||||
release.attributes_metadata = deepcopy(release.attributes_metadata)
|
||||
|
||||
try:
|
||||
del release.attributes_metadata['editable']['common']['use_vcenter']['restrictions']
|
||||
except:
|
||||
pass
|
||||
|
||||
release.roles_metadata = deepcopy(release.roles_metadata)
|
||||
|
||||
try:
|
||||
release.roles_metadata['compute-vmware']['public_ip_required'] = True
|
||||
except:
|
||||
pass
|
||||
|
||||
db().commit()
|
||||
return 0
|
||||
|
||||
|
||||
def main():
|
||||
return clear_restriction()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
EOF
|
||||
|
||||
cat > $TMPDIR/cluster.patch << 'EOF'
|
||||
--- cluster.py.orig 2015-09-15 14:42:26.231316542 +0000
|
||||
+++ cluster.py 2015-09-15 14:42:33.647312152 +0000
|
||||
@@ -224,14 +224,7 @@
|
||||
|
||||
@classmethod
|
||||
def _validate_net_provider(cls, data, cluster):
|
||||
- common_attrs = data.get('editable', {}).get('common', {})
|
||||
- net_provider = cluster.net_provider
|
||||
-
|
||||
- if common_attrs.get('use_vcenter', {}).get('value') is True and \
|
||||
- net_provider != consts.CLUSTER_NET_PROVIDERS.nova_network:
|
||||
- raise errors.InvalidData(u'vCenter requires Nova Network '
|
||||
- 'to be set as a network provider',
|
||||
- log_message=True)
|
||||
+ return True
|
||||
|
||||
@classmethod
|
||||
def validate_editable_attributes(cls, data):
|
||||
EOF
|
||||
|
||||
$CTL copy $CONTAINER:/usr/lib/python2.6/site-packages/nailgun/api/v1/validators/cluster.py $TMPDIR/cluster.py
|
||||
pushd $TMPDIR 1>/dev/null
|
||||
$PATCH -p0 -N --dry-run --silent < cluster.patch 2>/dev/null 1>/dev/null
|
||||
if [ $? -eq 0 ];
|
||||
then
|
||||
$PATCH -p0 -N < cluster.patch
|
||||
|
||||
$CTL copy $TMPDIR/cluster.py $CONTAINER:/usr/lib/python2.6/site-packages/nailgun/api/v1/validators/cluster.py
|
||||
$CTL shell $CONTAINER rm -f /usr/lib/python2.6/site-packages/nailgun/api/v1/validators/cluster.pyc /usr/lib/python2.6/site-packages/nailgun/api/v1/validators/cluster.pyo
|
||||
|
||||
$CTL restart $CONTAINER
|
||||
|
||||
# check all service started
|
||||
while :; do
|
||||
if [ -z "$($CTL shell $CONTAINER supervisorctl status|grep -v 'RUNNING')" ]; then break ; fi
|
||||
sleep 5
|
||||
done
|
||||
fi
|
||||
popd 1>/dev/null
|
||||
|
||||
$CTL copy $TMPDIR/patch.py $CONTAINER:/tmp/patch.py
|
||||
$CTL shell $CONTAINER python /tmp/patch.py 1>/dev/null
|
||||
|
||||
rm -fr $TMPDIR
|
|
@ -10,5 +10,6 @@ ROOT="$(dirname `readlink -f $0`)"
|
|||
version=$(sed -rn 's/^version:\s*([0-9.])/\1/p' $ROOT/metadata.yaml)
|
||||
name=$(sed -rn 's/^name:\s*(.*)/\1/p' $ROOT/metadata.yaml)
|
||||
|
||||
sed -i "s/NAME/$name/" $ROOT/deployment_scripts/puppet/manifests/hiera-override.pp
|
||||
sed -i "s/NAME/$name/" $ROOT/deployment_scripts/puppet/manifests/repo-priority.pp
|
||||
sed -i "s/VERSION/$version/" $ROOT/deployment_scripts/puppet/manifests/repo-priority.pp
|
||||
|
|
Binary file not shown.
Binary file not shown.
75
tasks.yaml
75
tasks.yaml
|
@ -1,9 +1,3 @@
|
|||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: pre_deployment/4010
|
||||
type: shell
|
||||
parameters:
|
||||
cmd: ./clean_overrides.sh
|
||||
timeout: 30
|
||||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: pre_deployment/4010
|
||||
type: puppet
|
||||
|
@ -11,71 +5,10 @@
|
|||
puppet_manifest: puppet/manifests/repo-priority.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 120
|
||||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/hiera-override.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 60
|
||||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: post_deployment/4010
|
||||
type: shell
|
||||
parameters:
|
||||
cmd: if [ -e /etc/hiera/override/plugins.yaml ]; then mv /etc/hiera/override/plugins.yaml /etc/hiera/override/plugins.yaml.nsxv ;fi ; ln -s /etc/hiera/override/plugins_nsxv.yaml /etc/hiera/override/plugins.yaml
|
||||
timeout: 30
|
||||
- role: ['primary-controller','controller']
|
||||
stage: post_deployment/4010
|
||||
stage: pre_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/nsxv-config.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/db.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/keystone.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller','controller']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-haproxy/openstack-haproxy-neutron.pp
|
||||
puppet_modules: /etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller','controller']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/neutron-install.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 900
|
||||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/nova-config.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller','controller']
|
||||
stage: post_deployment/4010
|
||||
type: puppet
|
||||
parameters:
|
||||
puppet_manifest: puppet/manifests/disable-nova-network.pp
|
||||
puppet_modules: puppet/modules:/etc/puppet/modules
|
||||
timeout: 300
|
||||
- role: ['primary-controller','controller','compute-vmware']
|
||||
stage: post_deployment/4010
|
||||
type: shell
|
||||
parameters:
|
||||
cmd: if [ -e /etc/hiera/override/plugins.yaml.nsxv ]; then mv -f /etc/hiera/override/plugins.yaml.nsxv /etc/hiera/override/plugins.yaml; fi
|
||||
timeout: 30
|
||||
puppet_manifest: puppet/manifests/patch-neutron-manifest.pp
|
||||
puppet_modules: puppet/modules
|
||||
timeout: 120
|
||||
|
|
Loading…
Reference in New Issue