update controller script

Change-Id: I0dc9b1ba89c754e252f57f3aa582274755078f70
This commit is contained in:
Kanzhe Jiang 2015-12-08 16:16:59 -08:00
parent 9c91afaf6c
commit 97913db098
2 changed files with 27 additions and 22 deletions

View File

@ -18,13 +18,22 @@ class bcf::controller {
include bcf::params include bcf::params
$binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin" $binpath = "/usr/local/bin/:/bin/:/usr/bin:/usr/sbin:/usr/local/sbin:/sbin"
package { 'python-pip':
ensure => 'installed',
}
exec { 'bsnstacklib':
command => 'pip install "bsnstacklib<2015.2"',
path => "/usr/local/bin/:/usr/bin/:/bin",
require => Package['python-pip']
}
# load bonding module # load bonding module
file_line {'load bonding on boot': file_line {'load bonding on boot':
path => '/etc/modules', path => '/etc/modules',
line => 'bonding', line => 'bonding',
match => '^bonding$', match => '^bonding$',
} }
# purge bcf controller public key # purge bcf controller public key
exec { 'purge bcf key': exec { 'purge bcf key':
command => "rm -rf /etc/neutron/plugins/ml2/host_certs/*", command => "rm -rf /etc/neutron/plugins/ml2/host_certs/*",
@ -76,7 +85,7 @@ class bcf::controller {
value => 'messaging', value => 'messaging',
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
# configure /etc/keystone/keystone.conf # configure /etc/keystone/keystone.conf
ini_setting { "keystone.conf notification driver": ini_setting { "keystone.conf notification driver":
ensure => present, ensure => present,
@ -87,7 +96,7 @@ class bcf::controller {
value => 'messaging', value => 'messaging',
notify => Service['keystone'], notify => Service['keystone'],
} }
# config /etc/neutron/plugin.ini # config /etc/neutron/plugin.ini
ini_setting { "neutron plugin.ini firewall_driver": ini_setting { "neutron plugin.ini firewall_driver":
ensure => present, ensure => present,
@ -111,7 +120,7 @@ class bcf::controller {
ensure => file, ensure => file,
content => 'dhcp-option-force=26,1400', content => 'dhcp-option-force=26,1400',
} }
# config /etc/neutron/l3-agent.ini # config /etc/neutron/l3-agent.ini
ini_setting { "l3 agent disable metadata proxy": ini_setting { "l3 agent disable metadata proxy":
ensure => present, ensure => present,
@ -129,8 +138,8 @@ class bcf::controller {
setting => 'external_network_bridge', setting => 'external_network_bridge',
value => '', value => '',
} }
# config /etc/neutron/plugins/ml2/ml2_conf.ini # config /etc/neutron/plugins/ml2/ml2_conf.ini
ini_setting { "ml2 type dirvers": ini_setting { "ml2 type dirvers":
ensure => present, ensure => present,
path => '/etc/neutron/plugins/ml2/ml2_conf.ini', path => '/etc/neutron/plugins/ml2/ml2_conf.ini',
@ -167,13 +176,20 @@ class bcf::controller {
value => '/etc/neutron/plugins/ml2', value => '/etc/neutron/plugins/ml2',
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
if $bcf::params::openstack::bcf_controller_2 == "" {
$server = $bcf::params::openstack::bcf_controller_1
}
else {
$server = "${bcf::params::openstack::bcf_controller_1},${bcf::params::openstack::bcf_controller_2}"
}
ini_setting { "ml2 restproxy servers": ini_setting { "ml2 restproxy servers":
ensure => present, ensure => present,
path => '/etc/neutron/plugins/ml2/ml2_conf.ini', path => '/etc/neutron/plugins/ml2/ml2_conf.ini',
section => 'restproxy', section => 'restproxy',
key_val_separator => '=', key_val_separator => '=',
setting => 'servers', setting => 'servers',
value => "${bcf::params::openstack::bcf_controller_1},${bcf::params::openstack::bcf_controller_2}", value => $server,
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
ini_setting { "ml2 restproxy server auth": ini_setting { "ml2 restproxy server auth":
@ -227,7 +243,7 @@ class bcf::controller {
section => 'restproxy', section => 'restproxy',
key_val_separator => '=', key_val_separator => '=',
setting => 'auth_url', setting => 'auth_url',
value => "${bcf::params::openstack::keystone_vip}:35357", value => "http://${bcf::params::openstack::keystone_vip}:35357",
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
ini_setting { "ml2 restproxy auth_user": ini_setting { "ml2 restproxy auth_user":
@ -257,7 +273,7 @@ class bcf::controller {
value => "${bcf::params::openstack::auth_tenant_name}", value => "${bcf::params::openstack::auth_tenant_name}",
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
# change ml2 ownership # change ml2 ownership
file { '/etc/neutron/plugins/ml2': file { '/etc/neutron/plugins/ml2':
owner => neutron, owner => neutron,
@ -265,7 +281,7 @@ class bcf::controller {
recurse => true, recurse => true,
notify => Service['neutron-server'], notify => Service['neutron-server'],
} }
# heat-engine, neutron-server, neutron-dhcp-agent and neutron-metadata-agent # heat-engine, neutron-server, neutron-dhcp-agent and neutron-metadata-agent
service { 'heat-engine': service { 'heat-engine':
ensure => running, ensure => running,
@ -287,9 +303,5 @@ class bcf::controller {
ensure => stopped, ensure => stopped,
enable => false, enable => false,
} }
service {'neutron-bsn-agent':
ensure => stopped,
enable => false,
}
} }

View File

@ -34,7 +34,7 @@ attributes:
weight: 11 weight: 11
type: "text" type: "text"
regex: regex:
source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}(?:\:(?:(6553[0-5])|(655[0-2]\d)|(65[0-4]\d{2})|(6[0-4]\d{3})|([1-5]\d{4})|([1-9]\d{1,3})|([1-9])))$' source: '(^$|^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}(?:\:(?:(6553[0-5])|(655[0-2]\d)|(65[0-4]\d{2})|(6[0-4]\d{3})|([1-5]\d{4})|([1-9]\d{1,3})|([1-9]))))$'
error: "Invalid IP address and port" error: "Invalid IP address and port"
bcf_controller_username: bcf_controller_username:
@ -57,10 +57,3 @@ attributes:
description: "The Openstack instance ID that is unique within the BCF fabric" description: "The Openstack instance ID that is unique within the BCF fabric"
weight: 30 weight: 30
type: "text" type: "text"
bcf_controller_os_mgmt:
value: ""
label: "Openstack Management Tenant Name"
description: "The tenant that defines Openstack management segments"
weight: 40
type: "text"