separate ivs setup into install and setup steps
Change-Id: Ibf64278a33eeac36d8a915aa5cd30ce8486ca5fa
This commit is contained in:
parent
7abb3f7233
commit
5250aff27a
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "Usage: $0 <bcf_version>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bcf_version=$1
|
||||
|
||||
# install ivs
|
||||
apt-get install -y libnl-genl-3-200
|
||||
apt-get -f install -y
|
||||
dpkg --force-all -i "/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/ivs_packages/ubuntu/ivs_${bcf_version}_amd64.deb"
|
||||
dpkg --force-all -i "/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/ivs_packages/ubuntu/ivs-dbg_${bcf_version}_amd64.deb"
|
||||
apt-get install -y apport
|
||||
|
||||
# full installation
|
||||
if [[ -f /etc/init/neutron-plugin-openvswitch-agent.override ]]; then
|
||||
cp /etc/init/neutron-plugin-openvswitch-agent.override /etc/init/neutron-bsn-agent.override
|
||||
fi
|
||||
|
||||
if [[ "$(id -u)" != "0" ]]; then
|
||||
echo -e "Please run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,8 +1,8 @@
|
|||
#!/bin/bash
|
||||
set -x
|
||||
|
||||
if [ "$#" -ne 7 ]; then
|
||||
echo "Usage: $0 <management interface> <management ip> <uplinks> <all used interfaces> <bridges' ip> <fuel_deployment_id> <bcf_version>" >&2
|
||||
if [ "$#" -ne 6 ]; then
|
||||
echo "Usage: $0 <management interface> <management ip> <uplinks> <all used interfaces> <bridges' ip> <fuel_deployment_id>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -16,7 +16,6 @@ declare -a interfaces=($4)
|
|||
IFS='{}'
|
||||
read -ra array1 <<< $5
|
||||
deployment_id=$6
|
||||
bcf_version=$7
|
||||
|
||||
cdr2mask ()
|
||||
{
|
||||
|
@ -26,18 +25,6 @@ cdr2mask ()
|
|||
echo ${1-0}.${2-0}.${3-0}.${4-0}
|
||||
}
|
||||
|
||||
# install ivs
|
||||
apt-get install -y libnl-genl-3-200
|
||||
apt-get -f install -y
|
||||
dpkg --force-all -i "/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/ivs_packages/ubuntu/ivs_${bcf_version}_amd64.deb"
|
||||
dpkg --force-all -i "/etc/fuel/plugins/fuel-plugin-bigswitch-1.0/ivs_packages/ubuntu/ivs-dbg_${bcf_version}_amd64.deb"
|
||||
apt-get install -y apport
|
||||
|
||||
# full installation
|
||||
if [[ -f /etc/init/neutron-plugin-openvswitch-agent.override ]]; then
|
||||
cp /etc/init/neutron-plugin-openvswitch-agent.override /etc/init/neutron-bsn-agent.override
|
||||
fi
|
||||
|
||||
echo '' > /etc/network/interfaces
|
||||
|
||||
# Process input arguments
|
||||
|
@ -65,6 +52,8 @@ for (( i=0; i<$len; i++ )); do
|
|||
internal_interface="mgm${deployment_id}"
|
||||
elif [[ "$key" =~ "br-ex" ]]; then
|
||||
internal_interface="ex${deployment_id}"
|
||||
else
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$internal_interface" =~ "$deployment_id" ]]; then
|
||||
|
@ -80,7 +69,6 @@ for (( i=0; i<$len; i++ )); do
|
|||
ifconfig $internal_interface netmask ${netmask}
|
||||
fi
|
||||
echo -e '\n' >> /etc/network/interfaces
|
||||
|
||||
fi
|
||||
done
|
||||
|
||||
|
@ -114,8 +102,6 @@ echo 'Restart openstack-nova-compute and neutron-bsn-agent'
|
|||
service nova-compute restart
|
||||
service neutron-bsn-agent restart
|
||||
|
||||
set +e
|
||||
|
||||
# Make sure only root can run this script
|
||||
if [[ "$(id -u)" != "0" ]]; then
|
||||
echo -e "Please run as root"
|
||||
|
@ -137,4 +123,3 @@ puppet module install --force puppetlabs-inifile
|
|||
puppet module install --force puppetlabs-stdlib
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
|
@ -56,28 +56,28 @@ class bcf::p_v::compute {
|
|||
|
||||
# Install rootwrap filter
|
||||
file { '/etc/neutron/rootwrap.d/network.filters':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/network.filters',
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/network.filters',
|
||||
}
|
||||
file { '/etc/neutron/rootwrap.d/api-metadata.filters':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/api-metadata.filters',
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/api-metadata.filters',
|
||||
}
|
||||
file { '/etc/neutron/rootwrap.d/baremetal-deploy-helper.filters':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/baremetal-deploy-helper.filters',
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/baremetal-deploy-helper.filters',
|
||||
}
|
||||
file { '/etc/neutron/rootwrap.d/baremetal-compute-ipmi.filters':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/baremetal-compute-ipmi.filters',
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/baremetal-compute-ipmi.filters',
|
||||
}
|
||||
file { '/etc/neutron/rootwrap.d/compute.filters':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/compute.filters',
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/rootwrap/compute.filters',
|
||||
}
|
||||
|
||||
package { 'python-pip':
|
||||
ensure => 'installed',
|
||||
ensure => 'installed',
|
||||
require => File['/etc/neutron/rootwrap.d/network.filters']
|
||||
}
|
||||
exec { 'bsnstacklib':
|
||||
|
@ -88,7 +88,7 @@ class bcf::p_v::compute {
|
|||
|
||||
# Install the cleanup script
|
||||
file { '/etc/bigswitch':
|
||||
ensure => 'directory',
|
||||
ensure => 'directory',
|
||||
require => Exec['bsnstacklib']
|
||||
}
|
||||
file { '/etc/bigswitch/bridge-cleanup.sh':
|
||||
|
@ -102,22 +102,22 @@ class bcf::p_v::compute {
|
|||
logoutput => true,
|
||||
require => File['/etc/bigswitch/bridge-cleanup.sh']
|
||||
}
|
||||
file { '/etc/bigswitch/ivs-setup.sh':
|
||||
file { '/etc/bigswitch/ivs-install.sh':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/p_v/ivs-setup.sh',
|
||||
source => 'puppet:///modules/bcf/p_v/ivs-install.sh',
|
||||
require => EXEC['clean up ovs bridges']
|
||||
}
|
||||
exec { 'set up ivs':
|
||||
command => "bash /etc/bigswitch/ivs-setup.sh ${bcf::mgmt_itf} ${mgmt_ip} ${bcf::itfs} ${interfaces} \'${bridge_ips}\' ${bcf::deployment_id} ${bcf::params::openstack::bcf_version}",
|
||||
exec { 'install ivs package':
|
||||
command => "bash /etc/bigswitch/ivs-install.sh ${bcf::params::openstack::bcf_version}",
|
||||
path => '/sbin:/usr/sbin/:/usr/local/bin/:/usr/bin/:/bin',
|
||||
logoutput => true,
|
||||
require => File['/etc/bigswitch/ivs-setup.sh']
|
||||
require => File['/etc/bigswitch/ivs-install.sh']
|
||||
}
|
||||
file { '/etc/default/ivs':
|
||||
ensure => file,
|
||||
mode => '0644',
|
||||
content => "DAEMON_ARGS=\"--hitless --inband-vlan 4092 -u ${ivs_uplink_str} --internal-port=${internal_port_str}\"",
|
||||
require => Exec['set up ivs'],
|
||||
require => Exec['install ivs package'],
|
||||
notify => Service['ivs'],
|
||||
}
|
||||
|
||||
|
@ -126,6 +126,18 @@ class bcf::p_v::compute {
|
|||
enable => true,
|
||||
}
|
||||
|
||||
file { '/etc/bigswitch/ivs-setup.sh':
|
||||
ensure => 'file',
|
||||
source => 'puppet:///modules/bcf/p_v/ivs-setup.sh',
|
||||
require => Service['ivs']
|
||||
}
|
||||
exec { 'set up ivs':
|
||||
command => "bash /etc/bigswitch/ivs-setup.sh ${bcf::mgmt_itf} ${mgmt_ip} ${bcf::itfs} ${interfaces} \'${bridge_ips}\' ${bcf::deployment_id}",
|
||||
path => '/sbin:/usr/sbin/:/usr/local/bin/:/usr/bin/:/bin',
|
||||
logoutput => true,
|
||||
require => File['/etc/bigswitch/ivs-setup.sh']
|
||||
}
|
||||
|
||||
# edit rc.local for cron job and default gw
|
||||
file { '/etc/rc.local':
|
||||
ensure => file,
|
||||
|
|
Loading…
Reference in New Issue