diff options
Diffstat (limited to 'framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests')
6 files changed, 209 insertions, 0 deletions
diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/netconfig.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/netconfig.pp new file mode 100644 index 00000000..b875d235 --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/netconfig.pp @@ -0,0 +1,21 @@ +include onos + +Exec{ + path => "/usr/bin:/usr/sbin:/bin:/sbin", + timeout => 180, + logoutput => "true", +} + +$neutron_settings = hiera_hash('quantum_settings') +$nets = $neutron_settings['predefined_networks'] +$gateway_ip = $nets['net04_ext']['L3']['gateway'] +$public_eth = $onos::public_eth + +file{ "/opt/netconfig.sh": + ensure => file, + content => template('onos/netconfig.sh.erb'), +}-> +exec{ 'set gatewaymac': + command => "sh /opt/netconfig.sh; + rm -rf /opt/netconfig.sh;", +} diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/neutron.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/neutron.pp new file mode 100644 index 00000000..df06bdb1 --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/neutron.pp @@ -0,0 +1,102 @@ +include onos + +Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] } + +$neutron_config = hiera_hash('quantum_settings') +$nets = $neutron_config['predefined_networks'] +$net04_ext = + {"shared"=>false, + "L2"=> + {"network_type"=>"vxlan", + "router_ext"=>true, + "segment_id"=>"10000"}, + "L3"=> $nets['net04_ext']['L3'], + "tenant"=>"admin"} +$net04 = + {"shared"=>false, + "L2"=> + {"network_type"=>"vxlan", + "router_ext"=>false, + "segment_id"=>"500"}, + "L3"=> $nets['net04']['L3'], + "tenant"=>"admin"} +$roles = $onos::roles +$network_type = 'vxlan' + +if member($roles, 'primary-controller') { +cs_resource { 'p_neutron-l3-agent': + ensure => absent, + require => Exec ['stop neutron'], +}-> +exec{ 'delete Neutron db': + command => "mysql -e 'drop database if exists neutron;'; + mysql -e 'create database neutron character set utf8;'; + mysql -e \"grant all on neutron.* to 'neutron'@'%';\"; + neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head;", + before => Service ['start neutron service'], +} + +} + + + +exec{ 'stop neutron': + command => "service neutron-server stop", +} +package { 'install git': + ensure => installed, + name => "git", +}-> + +file{ "/opt/networking-onos.tar": + source => "puppet:///modules/onos/networking-onos.tar", +}-> +file{ '/opt/onos_driver.sh': + source => "puppet:///modules/onos/onos_driver.sh", +} -> +exec{ 'install onos driver': + command => "sh /opt/onos_driver.sh;" +}-> + +neutron_config { 'DEFAULT/service_plugins': + value => 'onos_router,neutron.services.metering.metering_plugin.MeteringPlugin'; +}-> + + +neutron_plugin_ml2 { + 'ml2/mechanism_drivers': value => 'onos_ml2'; + 'ml2/tenant_network_types': value => 'vxlan'; + 'ml2_type_vxlan/vni_ranges': value => '100:50000'; + 'onos/password': value => 'admin'; + 'onos/username': value => 'admin'; + 'onos/url_path': value => "http://${onos::manager_ip}:8181/onos/vtn"; +}-> +service {'start neutron service': + name => "neutron-server", + ensure => running +} + + + +if member($roles, 'primary-controller') { + + Service<| title == 'start neutron service' |> -> + Openstack::Network::Create_network <||> + + Service<| title == 'start neutron service' |> -> + Openstack::Network::Create_router <||> + +openstack::network::create_network{'net04': + netdata => $net04, + segmentation_type => $network_type, +} -> + openstack::network::create_network{'net04_ext': + netdata => $net04_ext, + segmentation_type => $network_type, +} -> + openstack::network::create_router{'router04': + internal_network => 'net04', + external_network => 'net04_ext', + tenant_name => 'admin', +} +} diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-ha.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-ha.pp new file mode 100644 index 00000000..0c4482c7 --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-ha.pp @@ -0,0 +1 @@ +class {'onos::ha::haproxy':} diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-install.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-install.pp new file mode 100644 index 00000000..13994ee7 --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-install.pp @@ -0,0 +1,2 @@ +include onos +class{ 'onos::install':} diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-service.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-service.pp new file mode 100644 index 00000000..5aa591f3 --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/onos-service.pp @@ -0,0 +1,6 @@ +include onos + +class {'onos::config':} ~> +class {'onos::service':} + + diff --git a/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp new file mode 100644 index 00000000..26332f3c --- /dev/null +++ b/framework/scripts/installer/fuel/fuel-plugin-onos/deployment_scripts/puppet/manifests/ovs.pp @@ -0,0 +1,77 @@ +include onos + + +Exec{path => "/usr/bin:/usr/sbin:/bin:/sbin",} + +case $::operatingsystem{ +centos:{ + $neutron_ovs_agent='neutron-openvswitch-agent' + $ovs_service='openvswitch' + $cmd_remove_agent='chkconfig --del neutron-openvswitch-agent' +} +ubuntu:{ + $neutron_ovs_agent='neutron-plugin-openvswitch-agent' + $ovs_service='openvswitch-switch' + $cmd_remove_agent='update-rc.d neutron-plugin-openvswitch-agent remove' +} + +} + +$roles = $onos::roles + +if member($roles, 'primary-controller') { +cs_resource { "p_${neutron_ovs_agent}": + ensure => absent, + before => Service["shut down and disable Neutron's agent services"], + }} +else{ +exec{'remove neutron-openvswitch-agent auto start': + command => "touch /opt/service; + $cmd_remove_agent; + sed -i /neutron-openvswitch-agent/d /opt/service", + before => Service["shut down and disable Neutron's agent services"], +} +} + + +firewall{'222 vxlan': + port => [4789], + proto => 'udp', + action => 'accept', +}-> +service {"shut down and disable Neutron's agent services": + name => $neutron_ovs_agent, + ensure => stopped, + enable => false, +}-> +exec{'Stop the OpenvSwitch service and clear existing OVSDB': + command => "service $ovs_service stop ; + rm -rf /var/log/openvswitch/* ; + rm -rf /etc/openvswitch/conf.db ; + service $ovs_service start ;" + +} -> +exec{'Set ONOS as the manager': + command => "su -s /bin/sh -c 'ovs-vsctl set-manager tcp:${onos::manager_ip}:6640'", + +} + + +$public_eth = $onos::public_eth +if member($roles, 'compute') { +exec{"net config": + command => "ifconfig $public_eth up", +} +} +else +{ +exec{"sleep 20 for ovsconnect": + command => "sleep 20", + require => Exec['Set ONOS as the manager'], +}-> +exec{"delete public port from ovs of controllers": + command => "ovs-vsctl del-port br-int $public_eth", +} +} + + |